Project

General

Profile

InstallFromSource » History » Revision 15

Revision 14 (gstrauss, 2016-07-17 04:20) → Revision 15/40 (gstrauss, 2017-01-23 11:18)

h1. InstallFromSource 

 h2. Get the source 

 You can either use a release from "www.lighttpd.net/download"://www.lighttpd.net/download or compile from git: svn: 
 * Using a release/snapshot: 
   Extract the tar ball and enter the new directory: 
   <pre> 
 tar -xf lighttpd-1.4.XXX.tar.gz 
 cd lighttpd-1.4.XXX 
 </pre> 
 * git (you will need autoconf and automake for this): 
   First time: 
   <pre> 
 git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git 
 cd lighttpd1.4 
 ./autogen.sh 
 </pre> 
   Next time in @lighttpd1.4/@: 
   <pre> 
 git pull 
 ./autogen.sh 
 </pre> 
 * svn: instead of git you can also use svn, the initial checkout is created with: 
   <pre> 
 svn checkout https://github.com/lighttpd/lighttpd1.4/trunk lighttpd1.4 
 </pre> 
   And updates will be fetched with the usual: 
   <pre> 
 svn update 
 </pre> 

 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: 
 <pre> 
 apt-get build-dep lighttpd 
 </pre> 

 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. 

 h2. Configure 

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

 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: 
 <pre> 
 make 
 </pre> 

 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: 
 <pre> 
 su make install 
 </pre> 

 h2. signals Init script 

 lighttpd responds The init-script that is shipped with the source-tarball is meant to be run on a LSB conforming platform like SuSE, Fedora or Debian. 
 For 1.4.x versions from r2742/1.4.27 onwords , use doc/initscripts/ instead of doc/ in the following signals: commands below. 

 * SIGINT    - shut down gracefully    (finish serving existing connections and exit) <pre> 
 * SIGTERM - shut down immediately (terminate existing connections and exit) sed -e 's/FOO/lighttpd/g' doc/initscripts/rc.lighttpd > /etc/init.d/lighttpd 
 * SIGHUP    - re-open log files       (NOTE: does not reload lighttpd configuration) chmod a+rx /etc/init.d/lighttpd 
 cp -p doc/initscripts/sysconfig.lighttpd /etc/sysconfig/lighttpd 
 mkdir -p /etc/lighttpd 

 h2. graceful restart # < 1.4.27 
 install -Dp ./doc/lighttpd.conf /etc/lighttpd/lighttpd.conf 

 https://blog.lighttpd.net/articles/2005/09/02/graceful-restart/ # > 1.4.28 
 The current recommended way to reload cp -R doc/config/conf.d/ doc/config/*.conf doc/config/vhosts.d/ /etc/lighttpd/ 

 chkconfig lighttpd config is to gracefully stop and then to restart lighttpd. on 
 </pre> 

 h2. initscripts 

 Depending on the operating system and distribution brand, there are many ways If you're running *CentOS* or *RHEL* you might need to set up lighttpd to run as a daemon when change the system starts up, and first line to send signals to lighttpd for start/stop/restart/etc.    Rather this 
 <pre> 
 sed -e 's/FOO/lighttpd/g' doc/initscripts/rc.lighttpd.redhat > /etc/init.d/lighttpd 
 </pre> 

 In *Debian* / *Ubuntu* you use update-rc.d 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 chkconfig: 
 * Debian: https://anonscm.debian.org/cgit/pkg-lighttpd/lighttpd.git/tree/debian <pre> 
 * Fedora: http://pkgs.fedoraproject.org/cgit/rpms/lighttpd.git/tree/ update-rc.d lighttpd defaults 
 * Gentoo: https://gitweb.gentoo.org/repo/gentoo.git/tree/www-servers/lighttpd/files 
 * openSUSE: https://build.opensuse.org/package/show/server:http/lighttpd </pre> 

 h2. Supervise 

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