Security, speed, compliance, and flexibility--all of these describe LightTPD which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, CGI, Auth, Output-Compression,URL-Rewriting and many more) LightTPD is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.
What's with the name?
Light footprint + httpd = LightTPD
virtual directory listings
automatic expiration of files
Large File Support (64bit fileoffsets)
Ranges (start-end, start-, -end, multiple ranges)
on-the-fly output-compression with transparent caching
deflate, gzip, bzip2
backends: plain files, htpasswd, htdigest, ldap
fast and secure application controlled downloads
Server Side Includes
FastCGI, CGI, SSI
same speed as or faster than apache + mod_php4
includes a utility to spawn FastCGI processes (neccesary for PHP 4.3.x)
via FastCGI and CGI interface
support Code Caches like Turckmm, APC or eaccelarator
(one webserver distibutes request to multiple PHP-servers via FastCGI)
chroot(), set UID, set GID
strict HTTP-header parsing
Lighttpd Supported platforms
Releases of lighttpd are built regulary for at least the following platforms
Linux (binary packages for FC3, SuSE, Debian, Gentoo, PLD-Linux, OpenWRT)
*BSD (FreeBSD, NetBSD, OpenBSD, MacOS X)
while it is known to compile cleanly on
and various other POSIX compatible OSes
If there is no debian package for your platform you have to compile it yourself.
If you run unstable (Check you sources.list is configured for unstable),then you can install it via apt:
# apt-get update
# apt-get install lighttpd lighttpd-doc
This will install lighttpd in debian
Following are important files for lighttpd server:
The default lighttpd configuration file: /etc/lighttpd/lighttpd.conf (download sample lighttpd.conf file)
Service startup script: /etc/init.d/lighttpd (download sample lighttpd file)
These files are installed by default for all binary installations methods. Now lighttpd installed and it is time to configure lighttpd.
Understanding core lighttpd Directives
Following are core lighttpd Directives:
server.document-root = “/var/www/html”: Specifies default document-root for your server.
server.port = 80: Specifies default http port for your server.
server.username = “lighttpd”
server.groupname = “lighttpd”: Specifies default username and groups to start/stop lighttpd server. This is a security feature (as it drops root privileges).
server.bind = “server-ip-address”: Specify server ip-address. You can also specify hostname such as theos.in.
server.tag =”lighttpd”: Use to setup lighttpd name and version number (default). This is security feature. You can setup it as follows:
server.tag =”myWebServer v1.0
server.errorlog = “/var/log/lighttpd/error.log”: Specify the error-log file.
accesslog.filename = “/var/log/lighttpd”: Specify the accesslog file name (use to generate stats using stats software).
index-file.names = ( “index.php”, “index.html” ): A list of files to search for if a directory is requested.
server.modules = (
): Above modules are loaded by lighty:
mod_access: The access module is used to deny access to files with given trailing path names.
mod_accesslog: Use to write CLF log, flexible like apache
mod_fastcgi : FastCGI for perl/PHP etc
mod_rewrite : Good for writing SEO urls
mod_auth: Authntication (password protected directory)
mimetype.assign = (
“.pdf” => “application/pdf”,
“.sig” => “application/pgp-signature”
): Use to setup mimetype mapping.
If you want more available server modules and options check here
Open file /etc/lighttpd/lighttpd.conf and setup all of the above directives:
# vi /etc/lighttpd/lighttpd.conf
Save the file and start the lighttpd:
# /etc/init.d/lighttpd start
Verify that lighttpd is running:
# netstat -ntulp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 29855/sshd
tcp 0 0 184.108.40.206:80 0.0.0.0:* LISTEN 5866/lighttpd
Open you webbrowser and test by typing URL: http://your-domain.com/ or http://server-ip/