Cherokee web server
Warning this one got a bit complicated.
We start with ipkg install cherokee
However the server is not running at startup...
Adding a startup script
To make it run at startup there is one "proper" way and a few alternatives. The proper way is to place a special script in /etc/init.d and then enable the script using the command: update-rc.d
Here's the script I used, note it's almost certainly GPL code and I think I got it from the source "tarball". I've lost track of where it came from and I modified it to remove some options that busybox didn't support.
This script appears to work well enough to start the server, however the "restart" and "reload-modules" functions are dodgy. I think the script needs to wait after stopping the service in order for the port 80 to become available again, otherwise it doesn't restart properly.
The proper version of the script uses a retry option when shutting down the server to ensure that the server is stopped. I can't do that as the option isn't supported in busybox so I've bodged in a one second delay instead.
Hint: the easiest way to get that file onto the slug is probably:
Once you have the script you can activate it with:
update-rc.d cherokee defaults 60
and if you want to remove it deactivate it with:
update-rc.d -f cherokee remove
This should be enough to get you the default Cherokee home page.
Quick and dirty startup:
There is also a simpler way to get the server running if you have "cron" installed, you could add a line to the root crontab:
ConfigurationThe configuration files are located in /etc/cherokee/
The one you are interested in is cherokee.conf
I left most of it alone but I changed the user and group settings so it ran as www-data
Running a web server as root is considered bad practice generally, though it may be convenient on a test system that's not going to be exposed to the internet.
By default the HTML files are located at /var/www/
This behavior is set by a file in sites-available called "default". The convention is that each site you host has a file in sites-available and a link to it from sites-enabled.