What is this?
Lighttpd is a tiny, efficient, secure and flexible webserver designed for the specific concerns of limited environments or high load. A wealth of advanced features are offered, including FastCGI, CGI, Authentication, URL-Rewriting, Output Compression, WebDAV, and more.
This is a packaging up of Alice McGregor’s port of lighttpd for the iPhone. See her blog entry here.
Changing the root password
If you are going to run ssh, you need to change the root password to something only you know, since everyone knows the default root password on the iPhone (”dottie” for 1.0.2 or less, “alpine” for 1.1.1). How can you change it, you ask? Well, if you install the “BSD Subsystem” package, version 1.5 or newer, it includes the “passwd” command. Here’s all you have to do:
Open an ssh connection to your iPhone and login to it, using the default password. Now, run the command “passwd” (without the quotes) and change the password. Now, without exiting your ssh session, open a new window and try to login using your new password. If it works, you can log out of both sessions if you wish. If it does not work, you still have the original ssh session open to your iPhone, that you can use to correct the problem.
Conflicts:
This package may not be installed if the Apache package is installed. This package uses a different Document Root (~/Sites) than Apache, so you can switch back and forth if you so wish.
Recommended packages:
It is recommended that you install the Perl, Python & Ruby packages if you would like to use those scripting languages with lighttpd. Once installed, you can verify that they work by accessing the hello.pl, hello.py & hello.rb files, found directly in the Document Root (assuming they were installed, that is - if you already have a ~/Sites directory when you install lighttpd, it won’t be replaced by the default ~/Sites files from the package). The UIctl package is recommended for starting, stopping, enabling & disabling the server easily.
During a package update:
During an upgrade, this package will not overwrite your webserver logs. It also will not overwrite your (possibly customized) lighttpd conf file, but will install the new conf file as /usr/local/etc/lighttpd.conf.new. Please review it and merge any changes into your existing conf file, at your leisure. Be sure to restart the webserver afterwards (see the next section, which also includes how to do that). Lastly, nothing in ~/Sites will be disturbed during a package update.
Logging:
Error logging is turned on, by default, but access logging is not. If you need access logging, you can enable it by editing the /usr/local/etc/lighttpd.conf file, thusly:
Change: server.modules = ( “mod_cgi” )
To: server.modules = ( “mod_accesslog”, “mod_cgi” )
Then restart the webserver (in UIctl, do an “unload” & a “load” on the com.amcgregor.lighttpd list entry).
Modules:
See the file manifest, below, for the modules included. Note: at this time, the flv_streaming module is not included, as there were issues compiling it. The package will be updated to include it, should it become available in the future.
Enabling/Disabling lighttpd:
In UIctl do a “load -w” (to enable it) and an “unload -w” (to disable it) on the com.amcgregor.lighttpd list entry.
Files & Directories added or created by this package:
/Library/LaunchDaemons/com.amcgregor.lighttpd.plist
/usr/local/bin/lighttpd
/usr/local/bin/spawn-fcgi
/usr/local/etc/lighttpd.conf
/usr/local/etc/lighttpd.conf.new (if you’ve ever updated the pkg)
/usr/local/lib/liblightcomp.dylib
/usr/local/lib/liblightcomp.la
/usr/local/lib/libuuid.a
/usr/local/lib/mod_access.la
/usr/local/lib/mod_access.so
/usr/local/lib/mod_accesslog.la
/usr/local/lib/mod_accesslog.so
/usr/local/lib/mod_alias.la
/usr/local/lib/mod_alias.so
/usr/local/lib/mod_auth.la
/usr/local/lib/mod_auth.so
/usr/local/lib/mod_cgi.la
/usr/local/lib/mod_cgi.so
/usr/local/lib/mod_cml.la
/usr/local/lib/mod_cml.so
/usr/local/lib/mod_compress.la
/usr/local/lib/mod_compress.so
/usr/local/lib/mod_dirlisting.la
/usr/local/lib/mod_dirlisting.so
/usr/local/lib/mod_evasive.la
/usr/local/lib/mod_evasive.so
/usr/local/lib/mod_evhost.la
/usr/local/lib/mod_evhost.so
/usr/local/lib/mod_expire.la
/usr/local/lib/mod_expire.so
/usr/local/lib/mod_extforward.la
/usr/local/lib/mod_extforward.so
/usr/local/lib/mod_fastcgi.la
/usr/local/lib/mod_fastcgi.so
/usr/local/lib/mod_flv_streaming.la
/usr/local/lib/mod_flv_streaming.so
/usr/local/lib/mod_indexfile.la
/usr/local/lib/mod_indexfile.so
/usr/local/lib/mod_magnet.la
/usr/local/lib/mod_magnet.so
/usr/local/lib/mod_mysql_vhost.la
/usr/local/lib/mod_mysql_vhost.so
/usr/local/lib/mod_proxy.la
/usr/local/lib/mod_proxy.so
/usr/local/lib/mod_redirect.la
/usr/local/lib/mod_redirect.so
/usr/local/lib/mod_rewrite.la
/usr/local/lib/mod_rewrite.so
/usr/local/lib/mod_rrdtool.la
/usr/local/lib/mod_rrdtool.so
/usr/local/lib/mod_scgi.la
/usr/local/lib/mod_scgi.so
/usr/local/lib/mod_secdownload.la
/usr/local/lib/mod_secdownload.so
/usr/local/lib/mod_setenv.la
/usr/local/lib/mod_setenv.so
/usr/local/lib/mod_simple_vhost.la
/usr/local/lib/mod_simple_vhost.so
/usr/local/lib/mod_ssi.la
/usr/local/lib/mod_ssi.so
/usr/local/lib/mod_staticfile.la
/usr/local/lib/mod_staticfile.so
/usr/local/lib/mod_status.la
/usr/local/lib/mod_status.so
/usr/local/lib/mod_trigger_b4_dl.la
/usr/local/lib/mod_trigger_b4_dl.so
/usr/local/lib/mod_userdir.la
/usr/local/lib/mod_userdir.so
/usr/local/lib/mod_usertrack.la
/usr/local/lib/mod_usertrack.so
/usr/local/lib/mod_webdav.la
/usr/local/lib/mod_webdav.so
/var/log/lighttpd/access.log (if you enable access logging)
/var/log/lighttpd/error.log
The following files are only installed if ~/Sites does not exist:
/var/root/Sites/hello.pl
/var/root/Sites/hello.py
/var/root/Sites/hello.rb
/var/root/Sites/images
/var/root/Sites/images/bg.png
/var/root/Sites/images/iphone-webserver2.jpg
/var/root/Sites/index.html
On uninstallation, ~/Sites is not removed.
Changelog
1.4.17-2
Added the mod_flv_streaming module and libuuid.a (for WebDAV locking support).
1.4.17-1
Initial release.