Tuesday, January 5, 2010

EON ZFS Storage min and lighttpd web server

If you run one of the EON ZFS (NO HTTPD) storage images that do not include a web server this post will show how to easily add HTTPD service using the lighttpd or nginx web server. 

Prerequisite(s): A storage pool must be created and a binary kit must be installed. The binary kit is needed because it contains libpcre, a dynamic library needed by lighttpd.

Let's get started adding a lighttpd web server, to our ZFS min (NO HTTPD) storage image. First, get the pre-built lighttpd version 1.4.25 here. I have also included compilation notes under the lighttpd section in case you wish to compile and add other features on your own. Transfer the lighttpd-1.4.25.tgz file to the storage pool via CIFS share, sftp or USB. Here, I start with the file located in /tmp and a storage pool named abyss. Substitute your zpool name for abyss.
cd /abyss
gzip -dc /tmp/lighttpd-1.4.25.tgz | tar -xf -
Now let's add the automation entries to /mnt/eon0/.exec. Also, execute the commands to create the necessary symlinks. These entries align paths entered in lighttpd.conf
(cd /usr ; ln -s ../abyss/lighttpd .)
(cd /var ; ln -s ../abyss/lighttpd .)
At this stage, the lighttpd web server is ready to run, but feel free to customize the /abyss/lighttpd/etc/lighttpd.conf and generate your own /abyss/lighttpd/etc/server.pem file. OpenSSL (part of the binary kit which is a pre-requisite for this post) would be needed to generate your own self signed cert file (server.pem). To start and automate the web server, run and add the following to /mnt/eon0/.exec.
/usr/lighttpd/sbin/lighttpd -f /usr/lighttpd/etc/lighttpd.conf

No comments: