Lighttpd
上QQ阅读APP看书,第一时间看更新

Building Lighttpd using Autotools

Lighttpd was built using Autotools until version 1.5.0, in which the authors experimented with CMake (and other build systems). The Autotools build system has been around for some time. So, almost every system that has a sufficient toolchain can build Lighttpd.

Note that the building can and should be done as a normal user, while the installation must usually be done as a superuser, unless the target directory is owned by the normal user. The easiest way (provided we have sudo) is:

configure && make && sudo make install

Before we enter this command line, we can set a few environment variables that will affect the build process. We can do this in a bash compatible shell using:

export SOME_VAR=X

This will set the variable SOME_VAR to X and export it to the shell. Alternatively, we can just omit the export if we write the variable declarations at the beginning of our command, as in:

SOME_VAR=X; OTHER_VAR=Y; configure

Here are the most important variables:

configure takes some options to select features. These options are usually expressed as:

configure --with-lua=/usr/src/lua-5.1 --with-pcre

Note that for every "with-something" option, there also is a "without-something" option that does the exact opposite. Here are the most important options:

The make utility will use the Makefile that configure has generated to build and install Lighttpd. Configure Lighttpd to your needs, but the defaults will take care of most of them.