INSTALL 5.6 KB

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