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