InstallFromSource » History » Revision 15
Get the source¶You can either use a release from www.lighttpd.net/download or compile from git:
- Using a release/snapshot:
Extract the tar ball and enter the new directory:
tar -xf lighttpd-1.4.XXX.tar.gz cd lighttpd-1.4.XXX
- git (you will need autoconf and automake for this):
git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git cd lighttpd1.4 ./autogen.sh
Next time in
git pull ./autogen.sh
- svn: instead of git you can also use svn, the initial checkout is created with:
svn checkout https://github.com/lighttpd/lighttpd1.4/trunk lighttpd1.4
And updates will be fetched with the usual:
Depending on which features you want, you need other libraries; you will want at least libpcre and zlib, for more see OptionalLibraries.
On most systems you need to install the development version of the library packages, the library itself won't be enough!
On debian you can also use apt-get to install all build dependencies:
apt-get build-dep lighttpd
Here is the list used for the debian packages (without the packaging parts): libssl-dev, zlib1g-dev, libbz2-dev, libattr1-dev, libpcre3-dev, libmysqlclient15-dev, libfam-dev, libldap2-dev, libfcgi-dev, libgdbm-dev, libmemcached-dev, liblua5.1-0-dev, pkg-config, uuid-dev, libsqlite3-dev, libxml2-dev, libkrb5-dev.
Now you have to use the
./configure script - there is a help option for it:
Don't forget to set the
--prefix if you don't want to install in /usr/local.
If the configure step was successful, you can now build it:
After a successful build you may install the package. This is not needed, but you will have to give lighttpd the correct location of the modules if you don't (see ./lighttpd -h).
As you hopefully didn't use root to build the package, you probably have now to get root access:
su make install
lighttpd responds to the following signals:
- SIGINT - shut down gracefully (finish serving existing connections and exit)
- SIGTERM - shut down immediately (terminate existing connections and exit)
- SIGHUP - re-open log files (NOTE: does not reload lighttpd configuration)
The current recommended way to reload lighttpd config is to gracefully stop and then to restart lighttpd.
Depending on the operating system and distribution brand, there are many ways to set up lighttpd to run as a daemon when the system starts up, and to send signals to lighttpd for start/stop/restart/etc. Rather than attempting to maintain scripts for an unknown number of distros, here are links to a few, which can be used as examples.
- Arch: https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/lighttpd
- Debian: https://anonscm.debian.org/cgit/pkg-lighttpd/lighttpd.git/tree/debian
- Fedora: http://pkgs.fedoraproject.org/cgit/rpms/lighttpd.git/tree/
- Gentoo: https://gitweb.gentoo.org/repo/gentoo.git/tree/www-servers/lighttpd/files
- openSUSE: https://build.opensuse.org/package/show/server:http/lighttpd
As an alternative to init scripts you can setup a "supervised" lighttpd with daemontools or runit, see LighttpdUnderSupervise