Difference between revisions of "Chumby as a web server"
(→Install the ARM toolchain) |
|||
Line 9: | Line 9: | ||
=Install the ARM toolchain= | =Install the ARM toolchain= | ||
− | Follow | + | Follow these directions to install the [[GNU Toolchain]] for the ARM9 processor used in the chumby. |
=Download and unpack the source code for lighttpd= | =Download and unpack the source code for lighttpd= |
Revision as of 10:32, 12 August 2007
Here's how to build lighttpd for your chumby. You'll be creating and installing lighttpd to run from a USB dongle.
Contents
- 1 Put together a Linux system
- 2 Install the ARM toolchain
- 3 Download and unpack the source code for lighttpd
- 4 Build it
- 5 Install it
- 6 Create the document directories
- 7 Create a simple lighttpd.conf file
- 8 Create the "debugchumby" file to launch the server on boot
- 9 Reboot your chumby with the USB dongle installed
Put together a Linux system
Interanll, we use Ubuntu Dapper Drake, however, pretty much any contemporary Linux system will work. Be sure you have the normal GNU toolcahin installed - on Ubuntu and other Debian-based systems, sudo apt-get install build-essential
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 these directions to install the GNU Toolchain for the ARM9 processor used in the chumby.
Download and unpack the source code for lighttpd
# wget http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz # tar xzvf lighttpd-1.4.16.tar.gz
Build it
# cd lighttpd-1.4.16 # ./configure --build=i386-linux --host=arm-linux --prefix=/mnt/usb/lighty # make
Under Ubuntu, I typically create a directory at /mnt/usb
which will then be copied to a USB dongle, since Ubuntu normally mounts such devices at /media
. However, for your distro, you might want to simply mount a dongle at that mount point.
Install it
# make install
At this point, you should have a directory /mnt/usb/lighty
which has bin
, lib
and sbin
directories.
Copy this directory to a USB dongle - the dongle should have the lighty
directory at the top.
Create the document directories
Withing the lighty
directory, create the directories html
and cgi-bin
.
At this point, you might also want to create a simple index.html
file and put it in the html
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 lighttpd.conf
file and put it in the lighty
directory, with the contents:
server.modules = ( "mod_cgi", "mod_accesslog" ) 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 = ( "/mnt/usb/lighty/cgi-bin") 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" )
Create the "debugchumby" file to launch the server on boot
At the top level of the USB dongle, create a file called debugchumby
with the contents:
#!/bin/sh # kill the built-in web server killall httpd # create the log directory mkdir /tmp/logs # start lighttpd LD_LIBRARY_PATH=/mnt/usb/lighty/lib /mnt/usb/lighty/sbin/lighttpd -f /mnt/usb/lighty/lighttpd.conf
Reboot your chumby with the USB dongle installed
You should now have a web server responding on the IP of the chumby.