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