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