Install and configure lighttpd
From TekPedia
This guide is oriented for Gentoo linux, but the configuration is pretty similar for most distributions, so feel free to use another distribution.
[edit] Why lighttpd?
lighttpd doesnt ask anything to other popular web servers like apache, it's rich in features and lightweight, it has 20 to 30 pecent better performance over apaches' mod_php working with fastcgi. It also supports popular features as virtual hosting and url rewriting.
[edit] Installation
Before installing lighttpd you should check the use flags that you are going to use, some could prove to be handy, you can write a new entry in /etc/portage/package.use with the name of www-servers/lighttpd after you choose them.
Available lighttpd use flags:
USE="fastcgi ipv6 pcre ssl bzip2 doc fam gdbm ldap lua memcache minimal mysql php rrdtool test webdav xattr"
Then install:
emerge lighttpd
[edit] Post-Installation
After installing the server you can modify the configuration at the file /etc/lighttpd.conf or /etc/lighttpd/lighttpd.conf. Although lighttpd can run with the default configuration, its important to configure it to enable modules such as mod_rewrite, mod_fastcgi, mod_simple_vhost, etc...
Some important configurations are:
server.username = "lighttpd" server.groupname = "lighttpd"
Which configures the user and group that lighttpd will run as. Never run as the root user, that could create a security vulnerability.
server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm")
Which configures the files to be considered as directory indexes, lets call them the “default page”. Note the order is also important, in this case "index.php" will be used before "index.html".
server.errorlog = “/var/log/lighttpd/error.log”
Where lighttpd errors are going to be logged, very useful for debugging.
When you are done with the configuration you can start your brand new lighttpd server
/etc/init.d/lighttpd start
Make sure you add it to the default run level so it starts everytime you restart
rc-update add lighttpd default
