Installing a Cherokee Web Server on a OpenBSD Server
Posted by Craig Strong | Posted in Cherokee, OpenBSD, Web Servers | Posted on 12-09-2010
2
My main personal web servers run using Fedora and to date I have had no real problems and very reliable performance from this great Linux distribution. I generally stick the RH based distributions for familiarity reasons. Recently though I was setting up my development VM and I thought I’d try something a little different. I was looking for something with a much smaller footprint and something which is obviously simple and very secure and something which is not too far away from my Linux habits. Having done some extensive reading, OpenBSD seemed to stand out as one closer to my preferences. Light, simple and very secure with good documentation and support. So far I am very much enjoying the choice and think OpenBSD is firming a place in my future toolset.
Anyway setting up a web development environment is my goal my first port of call is to install Cherokee as my web server of choice. Having seen the performance benefits of this server (see other post), this was the sensible choice for me to make. I plan to install cacti, Yii Framework, PHPUnit, PHP5, XDebug and MySQL and Git as well as a few other tools to complete my development environment.
Coming from Fedora where YUM provides a great package management solution, I was pleased to see some similarities in OpenBSD with ports and pkg* tools. The documentation is good and as advised I added the packages references using my local mirror. Then I decided to choose the easy root and install cherokee 0.99 by running the following :
sudo pkg_add -v cherokee
This installed the package straight away and at the end of the install provided on screen guidance in configuring cherokee to start up on default. The follow settings are displayed :
If you want to run cherokee on boot, add these lines to /etc/rc.local:
if [ X"${cherokee_flags}" != X"NO" ]; then
echo -n ‘ cherokee’
/usr/local/sbin/cherokee ${cherokee_flags} 1> /dev/null
fi
for admin management:
if [ X"${cherokee-admin_flags}" != X"NO" ]; then
echo -n ‘ cherokee-admin’
/usr/local/sbin/cherokee-admin ${cherokee-admin_flags} 1> /dev/null &
fi
and in /etc/rc.conf.local:
cherokee_flags=”-d” # use -d to run in daemon mode
cherokee-admin_flags=NO # use -b if you want listen on ALL interfaces
After installing this, all seemed well and I followed the Cherokee installation guidelines by running the cherokee admin tool :
/usr/local/sbin/cherokee-admin – -bind 192.168.0.20 – -port 8080
This then presented with me with the relevant username and password settings to logging to cherokee admin. Using these details I tried logging into the admin section by going to :
bsdvm:8080
bsdvm is mapped to 192.168.0.20 in my hosts file (Both on my desktop machine and on my VM running openBSD).
On logging into the server I was presented with the following error :
“503 service unavailable”
The authentication seemed to work, so I was a little confused why this was happening. To debug the problem I run the command :
/usr/local/sbin/cherokee-admin –bind 192.168.0.20 –port 8080 –debug
Having run this command and trying to login again, the debug error messages were screaming about me not having python installed! I presumed that as I installed a package, python would have been included as one of the dependencies ? Obviously not and I remember having a similar problem when installing cherokee on Fedora a while back. Anyway I quickly solved the problem by installing the following :
pkg_add python-2.5.4p3.tgz
I then fired up cherokee-admin as above, and logged in without fail. Now it seems to be all running fine and I have setup my configuration settings on cherokee as I like them and my environment is running well.



