Chumby as a web server

Here's how to build lighttpd for your chumby. You'll be creating and installing lighttpd to run from a USB dongle.

=Put together a Linux development system=

Internally, we tend to use Kubuntu Dapper Drake, however, pretty much any contemporary Linux system will work. Be sure you have the normal GNU toolchain installed - on Ubuntu and other Debian-based systems,  should do the trick.

Under MacOS or Windows, you should be able to run something like VMWare to run a Linux system.

=Install the ARM toolchain=

Follow the directions to install the GNU Toolchain for the ARM9 processor used in the chumby.

=Download and unpack the source code for lighttpd=


 * 1) wget http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz
 * 2) tar xzvf lighttpd-1.4.16.tar.gz

=Build it=


 * 1) cd lighttpd-1.4.16
 * 2) ./configure --build=i386-linux --host=arm-linux --prefix=/mnt/usb/lighty
 * 3) make

Under Ubuntu, I typically create a directory at  which will then be copied to a USB dongle, since Ubuntu normally mounts such devices at. However, for your distro, you might want to simply mount a dongle at that mount point.


 * Note: under some environments, lighthttpd will fail to build with the following error:

configfile.c: In function 'config_parse_cmd': configfile.c:919: error: 'PATH_MAX' undeclared (first use in this function) configfile.c:919: error: (Each undeclared identifier is reported only once configfile.c:919: error: for each function it appears in.) configfile.c:919: warning: unused variable 'oldpwd' make[2]: *** [configfile.o] Error 1 make[2]: Leaving directory `/home/user/lighttpd-1.4.16/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/user/lighttpd-1.4.16' make: *** [all] Error 2

To fix this problem, edit the file  and add   to the beginning of the file. This problem was identified on Ubuntu Gutsy Server x86_64

=Install it=


 * 1) make install

At this point, you should have a directory  which has ,   and   directories.

Copy this directory to a USB dongle - the dongle should have the  directory at the top.

=Create the document directories=

Within the  directory, create the directories   and.

You'll put your HTML files in the  directory, and your scripts in the   directory.

At this point, you might also want to create a simple  file and put it in the   directory.

=Create a simple lighttpd.conf file=

So now we need a simple conf file to tell lighttpd what it's supposed to do. Create the file  file and put it in the   directory, with the contents:

server.modules = ( "mod_cgi", "mod_accesslog", "mod_alias" ) server.document-root = "/mnt/usb/lighty/html" server.errorlog = "/tmp/logs/lighttpd.error.log" accesslog.filename = "/tmp/logs/lighttpd.access.log" index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" ) cgi.assign = ( ".sh" => "/bin/sh", ".pl" => "/usr/bin/perl" ) alias.url = ( "/cgi-bin/" => "/mnt/usb/lighty/cgi-bin/", "/images/" => "/mnt/usb/images/" ) mimetype.assign            = (  ".pdf"          =>      "application/pdf",  ".sig"          =>      "application/pgp-signature",  ".spl"          =>      "application/futuresplash",  ".class"        =>      "application/octet-stream",  ".ps"           =>      "application/postscript",  ".torrent"      =>      "application/x-bittorrent",  ".dvi"          =>      "application/x-dvi",  ".gz"           =>      "application/x-gzip",  ".pac"          =>      "application/x-ns-proxy-autoconfig",  ".swf"          =>      "application/x-shockwave-flash",  ".tar.gz"       =>      "application/x-tgz",  ".tgz"          =>      "application/x-tgz",  ".tar"          =>      "application/x-tar",  ".zip"          =>      "application/zip",  ".mp3"          =>      "audio/mpeg",  ".m3u"          =>      "audio/x-mpegurl",  ".wma"          =>      "audio/x-ms-wma",  ".wax"          =>      "audio/x-ms-wax", ".ogg"         =>      "application/ogg", ".wav"         =>      "audio/x-wav", ".gif"         =>      "image/gif", ".jpg"         =>      "image/jpeg", ".jpeg"        =>      "image/jpeg", ".png"         =>      "image/png", ".xbm"         =>      "image/x-xbitmap", ".xpm"         =>      "image/x-xpixmap", ".xwd"         =>      "image/x-xwindowdump", ".css"         =>      "text/css", ".html"        =>      "text/html", ".htm"         =>      "text/html", ".js"          =>      "text/javascript", ".asc"         =>      "text/plain", ".c"           =>      "text/plain", ".cpp"         =>      "text/plain", ".log"         =>      "text/plain", ".conf"        =>      "text/plain", ".text"        =>      "text/plain", ".txt"         =>      "text/plain", ".dtd"         =>      "text/xml", ".xml"         =>      "text/xml", ".mpeg"        =>      "video/mpeg", ".mpg"         =>      "video/mpeg", ".mov"         =>      "video/quicktime", ".qt"          =>      "video/quicktime", ".avi"         =>      "video/x-msvideo", ".asf"         =>      "video/x-ms-asf", ".asx"         =>      "video/x-ms-asf", ".wmv"         =>      "video/x-ms-wmv", ".bz2"         =>      "application/x-bzip", ".tbz"         =>      "application/x-bzip-compressed-tar", ".tar.bz2"     =>      "application/x-bzip-compressed-tar" )

Note that this is a pretty minimal configuration file - we actually ended up building most of the lighttpd modules (they're in the  directory), so you may wish to review the online documentation to enable other capabilities.

=Create the "debugchumby" file to launch the server on boot=

At the top level of the USB dongle, create a file called  with the contents:

killall httpd mkdir /tmp/logs LD_LIBRARY_PATH=/mnt/usb/lighty/lib /mnt/usb/lighty/sbin/lighttpd -f /mnt/usb/lighty/lighttpd.conf
 * 1) !/bin/sh
 * 2) kill the built-in web server
 * 1) create the log directory
 * 1) start lighttpd

=Reboot your chumby with the USB dongle installed=

You should now have a web server responding on the IP of the chumby. You can get the IP by looking on the Settings->Chumby Info screen in the Control Panel.

Since the system is creating log files to, which is a RAM partition on the chumby, you'll eventually fill up the memory. At some point, you may wish to redirect the logs to the USB dongle, or to  if you don't want them at all - this is done by editing the   file.

=Don't want to build it yourself?=

No worries - we've already built this for you:
 * Download lighttpd_chumby_1.7.tar.gz to a USB dongle
 * Unpack it
 * Put the dongle into the back of your chumby and reboot!