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