1 2============ 3Installation 4============ 5 6 7Quick Installation 8------------------ 9 10Get lighttpd source from 11 12https://www.lighttpd.net/download/ 13 14unpack it by :: 15 16 $ tar xvJf lighttpd-1.4.xx.tar.xz 17 18compile and install it with :: 19 20 $ cd lighttpd-1.4.xx 21 $ ./configure -C 22 $ make 23 $ su - 24 # make install 25 # exit 26 27take look at the configfile in ./doc/lighttpd.conf, 28make your own copy of that file and modify it for your needs. 29 30 31Online documentation 32-------------------- 33https://redmine.lighttpd.net/projects/lighttpd/wiki/Devel 34https://redmine.lighttpd.net/projects/lighttpd/wiki/DevelSubversion 35https://redmine.lighttpd.net/projects/lighttpd/wiki/InstallFromSource 36 37 38Custom Installation 39------------------- 40 41required packages :: 42 43 autoconf 44 automake 45 libtool 46 m4 47 pcre 48 pcre-devel 49 pkg-config 50 51optional packages for optional features :: 52 53 bzip2-devel # bzip2 ./configure --with-bzip2 54 bzip2-libs 55 cyrus-sasl # SASL ./configure --with-sasl 56 cyrus-sasl-devel 57 gamin # FAM ./configure --with-fam 58 gamin-devel 59 gdbm # GDBM ./configure --with-gdbm 60 gdbm-devel 61 GeoIP-devel # GeoIP ./configure --with-geoip 62 GeoIP 63 gnutls # GnuTLS ./configure --with-gnutls 64 gnutls-devel 65 krb5-devel # Kerberos5 ./configure --with-krb5 66 krb5-libs 67 libattr # xattr ./configure --with-attr 68 libattr-devel 69 libbrotli # brotli ./configure --with-brotli 70 brotli-devel 71 libdbi # DBI ./configure --with-dbi 72 libdbi-devel 73 libdbi-dbd-mysql 74 libdbi-dbd-pgsql 75 libdbi-dbd-sqlite 76 libmaxminddb # MaxMindDB ./configure --with-maxminddb 77 libmaxminddb-devel 78 libmemcached-devel # Memcached ./configure --with-memcache 79 libmemcached-libs 80 libpq # Postgresql ./configure --with-pgsql 81 libpq-devel 82 libunwind # libunwind ./configure --with-libunwind 83 libuuid # libuuid ./configure --with-webdav-locks 84 libuuid-devel 85 libxml2 # libxml2 ./configure --with-webdav-props 86 libxml2-devel 87 libxml2-static 88 lua # Lua ./configure --with-lua 89 lua-devel 90 mariadb-devel # MariaDB ./configure --with-mysql 91 mariadb-libs 92 mbedtls # mbedTLS ./configure --with-mbedtls 93 mbedtls-devel 94 nettle # Nettle ./configure --with-nettle 95 nettle-devel 96 nss # NSS ./configure --with-nss 97 nss-devel 98 openldap # OpenLDAP ./configure --with-ldap 99 openldap-devel 100 openssl-devel # OpenSSL ./configure --with-openssl 101 openssl-libs 102 pam # PAM ./configure --with-pam 103 pam-devel 104 pcre # PCRE ./configure --with-pcre # (default) 105 pcre-devel 106 sqlite # SQLite ./configure --with-webdav-props 107 sqlite-devel 108 valgrind # valgrind ./configure --with-valgrind 109 valgrind-devel 110 zlib # zlib ./configure --with-zlib 111 zlib-devel 112 113more options: ./configure --help 114 115re-run ./configure after installing packages 116 117compile and install it with :: 118 119 $ cd lighttpd-1.4.xx 120 $ ./autogen.sh # detect/use newer versions of autotools (if present) 121 $ ./configure -C # add --with-xxxxx custom flags 122 $ make 123 # sudo make install 124 125 126Running Tests 127------------- 128 129required packages to run test harness :: 130 131 (e.g. on Fedora 22, sudo dnf install ...) 132 (e.g. on Arch Linux, sudo pacman ... (with lowercased package names)) 133 134 perl-CGI 135 perl-Digest 136 perl-Digest-MD5 137 perl-Encode-Locale 138 perl-HTML-Entities-Interpolate 139 perl-HTML-Parser 140 perl-HTML-Tagset 141 perl-HTTP-Date 142 perl-HTTP-Message 143 perl-IO-HTML 144 perl-LWP-MediaTypes 145 perl-Tie-Function 146 perl-TimeDate 147 php 148 php-cgi 149 150optional packages to run test harness :: 151 152 fcgi-devel 153 154 $ cd tests/ && make fcgi-auth fcgi-responder 155 156run test harness 157 158 $ make check 159 160run test harness with additional FastCGI tests (requires fcgi-devel package) 161 162 $ cd tests/ && make check-am 163 164 165static build using SCons 166------------------------ 167 168 $ scons -j 4 build_static=1 build_dynamic=0 prefix=/custom/inst/path install 169 170build_dynamic is enabled by default in SConstruct and needs to be disabled for 171the static build. See also the BoolVariable() settings in SConstruct for other 172configurable variables that might be set in a customized build. build_static=1 173can be replaced with build_fullstatic=1 to perform lighttpd static build with 174modules *and* to link statically against external dependencies. 175 176 177static build using make 178----------------------- 179 180* edit src/Makefile.am and, in the section under 'if LIGHTTPD_STATIC', 181 update lighttpd_SOURCES with each module to be included in the static build 182* create src/plugin-static.h with list of modules as PLUGIN_INIT(mod_foo) 183 for each module 'mod_foo' to be included in the static build 184 185 $ LIGHTTPD_STATIC=yes ./configure -C --enable-static=yes 186 $ make 187 $ sudo make install 188 189build using CMake and Xcode on Mac OS X with MacPorts 190----------------------------------------------------- 191* upgrade to latest Mac OS X 192* install Xcode from Apple Store (requires latest Mac OS X) 193* install MacPorts from https://www.macports.org/install.php 194 195 $ xcodebuild --license 196 $ xcode-select --install 197 $ sudo port selfupdate 198 $ sudo port install autoconf automake cmake libtool m4 pcre pkgconfig zlib brotli openssl libxml sqlite3 openldap fcgi p5-cgi libunwind libunwind-headers mysql57 libev gdbm openldap ossp-uuid 199 # Note: some of the above require more fiddling to configure with CMake... 200 201 # cmake and build 202 # (all -DWITH_... flags below are optional) 203 $ cmake -Wno-dev -DWITH_OPENSSL=1 -DWITH_LUA=1 -DWITH_ZLIB=1 -DWITH_BROTLI=1 -DWITH_WEBDAV_PROPS=1 . 204 $ make -j 4 205 $ make test 206 207 # Note: many tests fail if not built with openssl 208 # lighttpd will not start up with tests/lighttpd.conf 209 # (mod_secdownload fails to configure hmac-sha1 and hmac-sha256) 210