Sunday, 18 September 2011

lighttpd so easy to set up :)

Working sat night examining test runs and results.

I have script that processes results and spits out some URLs.
It runs in Hudson using ssh plugin.
When on from home the link to URLs (like file:///wherever) don't work.  :-(

So ...
# Google lighttpd install. 
#Get lighttpd src.
mkdir ~/src; cd ~/src;  wget
tar -zxvf lighttpd*.gz
cd lighttpd-1.4.13 
#Configure build/install. Hmm. Need to configure to install and run from user area. Configure.
echo $HOME
./configure --prefix=$HOME/src/usr --sysconfdir=$HOME/src/etc --datadir=$HOME/src/usr/share --localstatedir=$HOME/src/var
mkdir -p $HOME/src/{usr/share,var} 
#Build and Install
make; make install

#Configure lighttpd to serve up test results dir, port 8888, allow dir browsing, log access area.
cp ~/src/lighttpd-1.4.13/openwrt/lighttpd.conf ~/src/etc/lighttpd.conf
vi ../etc/lighttpd.conf

-#                              "mod_accesslog"
+                               "mod_accesslog"

-server.document-root             = "/www/"
+server.document-root             = "/projects/__TEST_RESULT_AREA__/"

-# accesslog.filename          = "/www/logs/access.log"
+accesslog.filename          = "/__HOMEDIR__/src/www/logs/access.log"

-#server.port                = 81
+server.port                = 8888

-#server.dir-listing          = "enable"
+server.dir-listing          = "enable"
diff -u ~/src/lighttpd-1.4.13/openwrt/lighttpd.conf ~/src/etc/lighttpd.conf

cat > ~/src/  <<EOT
cd ~/src
./usr/sbin/lighttpd -f etc/lighttpd.conf
# Browse results. happy dance. 

No comments: