InstallFromSource » History » Revision 12

Revision 11 (stbuehler, 2016-04-08 16:18) → Revision 12/35 (stbuehler, 2016-04-08 16:19)

h1. InstallFromSource 

 h2. Get the source 

 You can either use a release from "":// or compile from svn: 
 * 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 

 Troubleshooting: if you encounter any errors when running ./ or building, 
 please ensure you have installed the latest development tools available for the following packages: 
 - autoconf 
 - automake 
 - libtool 
 - m4 
 - pkg-config 

 See [[DevelSubversion]] 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 

 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, libmemcache-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: 
 ./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. Init script 

 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 commands below. 

 sed -e 's/FOO/lighttpd/g' doc/initscripts/rc.lighttpd > /etc/init.d/lighttpd 
 chmod a+rx /etc/init.d/lighttpd 
 cp -p doc/initscripts/sysconfig.lighttpd /etc/sysconfig/lighttpd 
 mkdir -p /etc/lighttpd 

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

 # > 1.4.28 
 cp -R doc/config/conf.d/ doc/config/*.conf doc/config/vhosts.d/ /etc/lighttpd/ 

 chkconfig lighttpd on 

 If you're running *CentOS* or *RHEL* you might need to change the first line to this 
 sed -e 's/FOO/lighttpd/g' doc/initscripts/rc.lighttpd.redhat > /etc/init.d/lighttpd 

 In *Debian* / *Ubuntu* you use update-rc.d rather than chkconfig: 
 update-rc.d lighttpd defaults 

 h2. Supervise 

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