MDLog:/sysadmin

The Journal Of A Linux Sysadmin

Lighttpd Debian Package Available in Etch

| Comments

Lighttpd is a small and fast webserver developed with security in mind and a lot of features. Until recently Debian packages were available only in the unstable release, but now they have been included in Debian Etch (testing) and will most certainly make it to the next stable Debian release (etch is scheduled to be released in December).

Myself I have been using Lighty for a while, either compiled from sources or using the unstable debian package that worked very well for me without any special problems. Though I am using it only to serve static content (images mainly) and not use any other special features. In this case lighttpd outperforms apache in my experiences by far in performance (requests / second) and also resources utilizations (CPU and memory).

So what do we have available in latest debian testing update? We have of course the latest stable version 1.4.13 released on 2006-10-09.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
aptitude show lighttpd
Package: lighttpd
New: yes
State: installed
Automatically installed: no
Version: 1.4.13-4
Priority: optional
Section: web
Maintainer: Debian lighttpd maintainers

Uncompressed Size: 750k
Depends: libattr1 (>= 2.4.4-1), libbz2-1.0, libc6 (>= 2.3.6-6), libldap2 (>= 2.1.17-1), libpcre3 (>= 4.5),
libssl0.9.8 (>= 0.9.8c-1), zlib1g (>= 1:1.2.1), lsb-base (>= 3.0-3), mime-support
Recommends: php4-cgi | php5-cgi
Suggests: openssl, rrdtool, apache2-utils
Provides: httpd, httpd-cgi
Description: A fast webserver with minimal memory footprint
lighttpd is a small webserver and fast webserver developed with security in mind and a lot of features. It has
support for
* CGI, FastCGI and SSI
* virtual hosts
* URL rewriting
* authentication (plain files, htpasswd, ldap)
* transparent content compression
* conditional configuration
and configuration is straight-forward and easy.

Homepage: http://www.lighttpd.net

Also besides the main package there are other additions available:

i   lighttpd   - A fast webserver with minimal memory footprint
p   lighttpd-doc   - Documentation for lighttpd
p   lighttpd-mod-cml   - Cache meta language module for lighttpd
p   lighttpd-mod-magnet   - Control the request handling module for lighttpd
p   lighttpd-mod-mysql-vhost   - MySQL-based virtual host configuration for lighttpd
p   lighttpd-mod-trigger-b4-dl   - Anti-deep-linking module for lighttpd
p   lighttpd-mod-webdav   - WebDAV module for lighttpd

The configuration file consists from one main file: /etc/lighttpd/lighttpd.conf and also some extra configuration files for some modules:

/etc/lighttpd/conf-available/
10-auth.conf
10-cgi.conf
10-cml.conf
10-fastcgi.conf
10-proxy.conf
10-simple-vhost.conf
10-ssi.conf
10-ssl.conf
10-trigger-b4-dl.conf
10-userdir.conf

Enabling the extra modules can be done using lighty-enable-mod and disable with lighty-disable-mod scripts, or this can be done manually by creating symlinks from conf-available/ to conf-enabled/. For example to enable fastcgi (that most people using lighty with php will probably want to enable ;)) you just have to run:

lighty-enable-mod fastcgi

As with the apache a2enmod/a2dismod running the script without any parameters will show the available choices (modules that can be enabled/disabled):

1
2
3
4
lighty-enable-mod
Available modules: auth cgi cml fastcgi proxy simple-vhost ssi ssl trigger-b4-dl userdir
Already enabled modules:
Enable module: 

Besides the extra modules, lighttpd comes with the following modules available (and enabled in the default configuration file):

  • enabled by default: mod_access, mod_alias, mod_accesslog
  • disabled by default: mod_rewrite, mod_redirect, mod_status, mod_evhost, mod_compress, mod_usertrack, mod_rrdtool, mod_webdav, mod_expire, mod_flv_streaming, mod_evasive

From /etc/lighttpd/lighttpd.conf:

server.modules              = (
"mod_access",
"mod_alias",
"mod_accesslog",
#           "mod_rewrite",
#           "mod_redirect",
#           "mod_status",
#           "mod_evhost",
#           "mod_compress",
#           "mod_usertrack",
#           "mod_rrdtool",
#           "mod_webdav",
#           "mod_expire",
#           "mod_flv_streaming",
#           "mod_evasive"
)

To enable one of the other modules just uncomment the particular module and define the proper configurations for it, if it is the case (use the lighttpd documentation for more details about each module), and restart lighty:

/etc/init.d/lighttpd restart

I hope you enjoyed this post, that wanted to introduce this great web server software and the particularity of the debian package and its specific tools and default configurations.

Comments