Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: m23402027 on August 04, 2011, 09:22:54 PM
-
Hi everyone,
I am new in this tinycore/microcore distribution. My system is Dell Mini 9 (no internal SSD - broken), so I installed tinycore iso image to USB using Universal USB Installer, and it is confirmed that persistence is enabled.
Right now I am trying to setup a web server that uses Lighttpd, PHP, and MySQL. In UBUNTU distros this was a real piece of cake but I am completely lost in Tinycore.
Using Apps I selected and installed each packages one by one, and it is confirmed that installation was done successfully.
The problem is I don't know how to start this web server successfully, I know it is lame, many search results in this forum says lighttpd -D -f lighttpd.conf, I can not find lighttpd.conf, referring to the original documentation in http://redmine.lighttpd.net also does not point to successful setup as I believe the working directories mentioned in http://redmine.lighttpd.net are completely different in TinyCore system.
Can anyone tell me a great step to install this web server and configure it to run each time at startup, because I can not find any thread that explicitly tells command by command to setup this simple kind web server, Please?
Thanks everyone.
-
Hi m23402027
Run AppBrowser and read the comments on the Info tab for lighttpd.tcz. It gives an example for
setting up the config file.
-
Thanks for replying Rich.
In the info section there is this comment:
Example chroot script:
HTTPD=/usr/local/sbin/lighttpd
HTTPD_ROOT=/www
HTTPD_CONF=$HTTPD_ROOT/lighttpd.conf
cat << EOF > $HTTPD_CONF
server.document-root = "/htdocs"
server.port = 80
server.username = "nobody"
server.groupname = "nogroup"
server.chroot = "$HTTPD_ROOT"
EOF
exec $HTTPD -D -f $HTTPD_CONF
In the last line I see the script executed $HTTPD which is the lighttpd binary itself, with configuration file defined in $HTTP_CONF simply at /www/lighttpd.conf. What I don't understand is the corresponding folder /www or even /www/lighttpd.conf file doesn't exist in the default installation, even after installing lighttpd.tcz.
Back again then, what should I do to make this work? the info itself doesn't say pretty much.
-
Hi m23402027
I'm not familiar with these particular packages, but based on the info section I suspect it does not
come with a default lighttpd.conf file. I could be wrong, but it looks like you are supposed to
create a /www directory.
-
Yes, sir. I agree with you. I guess I must setup the whole working enviroment directory and download all those original *.conf files from http://redmine.lighttpd.net. I will give it a try first and report here if there are any progress. Maybe made some little walkthrough...
-
Here is the script I use to create my lighttpd.conf and start it up. I do both at once to simplify the example. You will only need to create the lighttpd.conf once if you store it on persistent media.
# Start Lighttpd
HTTPD=/usr/local/sbin/lighttpd
HTTPD_ROOT=/mnt/hda1/www
HTTPD_CONF=$HTTPD_ROOT/lighttpd.conf
cat << EOF > $HTTPD_CONF
mimetype.assign = (".html" => "text/html")
server.document-root = "/htdocs"
server.port = 80
server.username = "nobody"
server.groupname = "nogroup"
server.chroot = "$HTTPD_ROOT"
EOF
exec $HTTPD -f $HTTPD_CONF &>/dev/null
My /mnt/hda1/www/htdocs directory contains my web root with index.html, etc. Note that you don't have to run lighttpd in a chroot, but I do it because it is so simple. Let me know if you need more assistance.
-
Hi Daniel, if made it! your script worked on the fly. Now I am stuck in PHP. How to make Lighttpd and PHP plays nice each other? because whenever I open a php link in my browser it tries to download the php file, i mean the server not parsing those php files
-
Try adding ".php" => "application/x-httpd-php" within mimetype.assign:
mimetype.assign = (".html" => "text/html", ".php" => "application/x-httpd-php")
-
Thanks for fast response.
I tried adding that, but still cannot. Is this has something to do with mod_fastcgi?
-
I've not used it with PHP, so I can't answer for certain. I know several here have, though, and maybe one of them can give details.
-
That's fine. LOL now I'm trying Apache modules, see how it is gonna work.
-
the php5 info file says how to setup php-cgi with lighttpd
Edit: Here is a link to a post with a ligthttpd config for php that I used to use: http://forum.tinycorelinux.net/index.php?topic=4892.msg25796#msg25796 (http://forum.tinycorelinux.net/index.php?topic=4892.msg25796#msg25796)
-
Thanks Robc!. Great! i'm gonna try it.
-
LOL ! I was also lost seting-up Lighttpd, php etc.
Ultimately I setup Apache,PHP,mySQL on Knoppix distro. Am still using Knoppix for my webserver testing needs.
But I will like using Apache,mySQL etc in TCL, though !
~Pats