InstallFromSource » History » Revision 20

Revision 19 (gstrauss, 2017-01-25 05:22) → Revision 20/33 (ardhill, 2020-05-17 08:24)

h1. InstallFromSource 

 h2. Get the source 

 You can either use a release from "":// 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): 
   First time: 
 git clone 
 cd lighttpd1.4 
   Next time in @lighttpd1.4/@: 
 git pull 
 * svn: instead of git you can also use svn, the initial checkout is created with: 
 svn checkout lighttpd1.4 
   And updates will be fetched with the usual: 
 svn update 

 Also see [[DevelGit]] and [[Devel]]. 

 h2. Install dependencies 

 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 

 h2. Configure 

 Now you have to use the @./configure@ script - there is a help option for it: 
 ./configure --help 

 Don't forget to set the @--prefix@ if you don't want to install in /usr/local. 

 h2. Build 

 If the configure step was successful, you can now build it: 

 h2. Install 

 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 

 h2. signals 

 lighttpd responds to the following signals: 

 * SIGTERM - shut down immediately (terminate existing connections, then exit) 
 * SIGINT    - shut down gracefully    (serve existing connections, then exit) 
 * SIGUSR1 - reload gracefully       (serve existing connections, then reload config) 
 * SIGHUP    - re-open log files       (NOTE: does not reload lighttpd configuration) 

 (Note: SIGUSR1 behavior is available in lighttpd 1.4.46 and later) 

 h2. graceful restart 
 The current recommended way to reload lighttpd config is to gracefully stop and then to restart lighttpd. 

 With lighttpd 1.4.46 and later, SIGUSR1 is the recommended method to gracefully handle configuration reloads and log rotation, though a graceful stop and then restart of lighttpd is still required for lighttpd configurations which chroot. 

 h2. initscripts 

 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: 
 * Debian: 
 * Fedora: 
 * Gentoo: 
 * openSUSE: 

 sample systemd unit script "lighttpd.service": 

 h2. Supervise 

 As an alternative to init scripts you can setup a "supervised" lighttpd with daemontools or runit, see [[LighttpdUnderSupervise]]