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 gnutls # GnuTLS ./configure --with-gnutls 64 gnutls-devel 65 krb5-devel # Kerberos5 ./configure --with-krb5 66 krb5-libs 67 libbrotli # brotli ./configure --with-brotli 68 brotli-devel 69 libdbi # DBI ./configure --with-dbi 70 libdbi-devel 71 libdbi-dbd-mysql 72 libdbi-dbd-pgsql 73 libdbi-dbd-sqlite 74 libdeflate # libdeflate ./configure --with-libdeflate 75 libdeflate-devel 76 libmaxminddb # MaxMindDB ./configure --with-maxminddb 77 libmaxminddb-devel 78 libpq # Postgresql ./configure --with-pgsql 79 libpq-devel 80 libunwind-devel # libunwind ./configure --with-libunwind 81 libuuid # libuuid ./configure --with-webdav-locks 82 libuuid-devel 83 libxml2 # libxml2 ./configure --with-webdav-props 84 libxml2-devel 85 libxml2-static 86 lua # Lua ./configure --with-lua 87 lua-devel 88 mariadb-devel # MariaDB ./configure --with-mysql 89 mariadb-libs 90 mbedtls # mbedTLS ./configure --with-mbedtls 91 mbedtls-devel 92 nettle # Nettle ./configure --with-nettle 93 nettle-devel 94 nss # NSS ./configure --with-nss 95 nss-devel 96 openldap # OpenLDAP ./configure --with-ldap 97 openldap-devel 98 openssl-devel # OpenSSL ./configure --with-openssl 99 openssl-libs 100 pam # PAM ./configure --with-pam 101 pam-devel 102 pcre # PCRE ./configure --with-pcre 103 pcre-devel 104 pcre2 # PCRE ./configure --with-pcre2 # (default) 105 pcre2-devel 106 sqlite # SQLite ./configure --with-webdav-props 107 sqlite-devel 108 valgrind # valgrind ./configure --with-valgrind 109 valgrind-devel 110 wolfssl # wolfSSL ./configure --with-wolfssl 111 wolfssl-devel 112 zlib # zlib ./configure --with-zlib # (default) 113 zlib-devel 114 libzstd # zstd ./configure --with-zstd 115 libzstd-devel 116 117more options: ./configure --help 118 119re-run ./configure after installing packages 120 121compile and install it with :: 122 123 $ cd lighttpd-1.4.xx 124 $ ./autogen.sh # detect/use newer versions of autotools (if present) 125 $ ./configure -C # add --with-xxxxx custom flags 126 $ make 127 # sudo make install 128 129 130Running Tests 131------------- 132 133required packages to run test harness :: 134 135 (e.g. on Fedora 22, sudo dnf install ...) 136 (e.g. on Arch Linux, sudo pacman ... (with lowercased package names)) 137 138 perl-Digest 139 perl-Digest-MD5 140 perl-Encode-Locale 141 perl-HTML-Entities-Interpolate 142 perl-HTML-Parser 143 perl-HTML-Tagset 144 perl-HTTP-Date 145 perl-HTTP-Message 146 perl-IO-HTML 147 perl-LWP-MediaTypes 148 perl-Test-Harness 149 perl-Test-Simple 150 perl-Tie-Function 151 perl-TimeDate 152 153run test harness 154 155 $ make check 156 157 158static build using SCons 159------------------------ 160 161 $ scons -j 4 build_static=1 build_dynamic=0 prefix=/custom/inst/path install 162 163build_dynamic is enabled by default in SConstruct and needs to be disabled for 164the static build. See also the BoolVariable() settings in SConstruct for other 165configurable variables that might be set in a customized build. build_static=1 166can be replaced with build_fullstatic=1 to perform lighttpd static build with 167modules *and* to link statically against external dependencies. 168 169 170static build using make 171----------------------- 172 173* edit src/Makefile.am and, in the section under 'if LIGHTTPD_STATIC', 174 update lighttpd_SOURCES with each module to be included in the static build 175* create src/plugin-static.h with list of modules as PLUGIN_INIT(mod_foo) 176 for each module 'mod_foo' to be included in the static build 177 178 $ LIGHTTPD_STATIC=yes ./configure -C --enable-static=yes 179 $ make 180 $ sudo make install 181 182build using CMake and Xcode on Mac OS X with MacPorts 183----------------------------------------------------- 184* upgrade to latest Mac OS X 185* install Xcode from Apple Store (requires latest Mac OS X) 186* install MacPorts from https://www.macports.org/install.php 187 188 $ xcodebuild --license 189 $ xcode-select --install 190 $ sudo port selfupdate 191 $ sudo port install autoconf automake cmake libtool m4 pcre2 pkgconfig zlib zstd brotli openssl libxml sqlite3 openldap libunwind libunwind-headers mysql57 openldap ossp-uuid 192 # Note: some of the above require more fiddling to configure with CMake... 193 194 # cmake and build 195 # (all -DWITH_... flags below are optional) 196 $ 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 . 197 $ make -j 4 198 $ make test 199