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