Skip to content

Commit 140c0fb

Browse files
committed
[doc] update README and INSTALL
also add tests/README with some testing notes
1 parent c946b19 commit 140c0fb

File tree

3 files changed

+229
-15
lines changed

3 files changed

+229
-15
lines changed

INSTALL

+140-9
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@
33
Installation
44
============
55

6-
:author: Jan Kneschke
7-
:Date: $Date: $
8-
:Revision: $Revision: $
96

10-
Installation
11-
------------
7+
Quick Installation
8+
------------------
129

13-
Get the source from
10+
Get lighttpd source from
1411

1512
https://www.lighttpd.net/download/
1613

1714
unpack it by ::
1815

19-
$ gzip -cd lighttpd-1.x.x.tar.gz | tar xf -
16+
$ tar xvJf lighttpd-1.4.xx.tar.xz
2017

2118
compile and install it with ::
2219

23-
$ cd lighttpd-1.x.x
24-
$ ./configure
20+
$ cd lighttpd-1.4.xx
21+
$ ./configure -C
2522
$ make
2623
$ su -
2724
# make install
@@ -31,6 +28,140 @@ take look at the configfile in ./doc/lighttpd.conf,
3128
make your own copy of that file and modify it for your needs.
3229

3330

31+
Online documentation
32+
--------------------
33+
https://redmine.lighttpd.net/projects/lighttpd/wiki/Devel
34+
https://redmine.lighttpd.net/projects/lighttpd/wiki/DevelSubversion
35+
https://redmine.lighttpd.net/projects/lighttpd/wiki/InstallFromSource
36+
37+
38+
Custom Installation
39+
-------------------
40+
41+
required packages ::
42+
43+
autoconf
44+
automake
45+
libtool
46+
m4
47+
pcre
48+
pcre-devel
49+
pkg-config
50+
51+
optional 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+
gamin # FAM ./configure --with-fam
58+
gamin-devel
59+
gdbm # GDBM ./configure --with-gdbm
60+
gdbm-devel
61+
GeoIP-devel # GeoIP ./configure --with-geoip
62+
GeoIP
63+
gnutls # GnuTLS ./configure --with-gnutls
64+
gnutls-devel
65+
krb5-devel # Kerberos5 ./configure --with-krb5
66+
krb5-libs
67+
libattr # xattr ./configure --with-attr
68+
libattr-devel
69+
libbrotli # brotli ./configure --with-brotli
70+
brotli-devel
71+
libdbi # DBI ./configure --with-dbi
72+
libdbi-devel
73+
libdbi-dbd-mysql
74+
libdbi-dbd-pgsql
75+
libdbi-dbd-sqlite
76+
libmaxminddb # MaxMindDB ./configure --with-maxminddb
77+
libmaxminddb-devel
78+
libmemcached-devel # Memcached ./configure --with-memcache
79+
libmemcached-libs
80+
libpq # Postgresql ./configure --with-pgsql
81+
libpq-devel
82+
libunwind # libunwind ./configure --with-libunwind
83+
libuuid # libuuid ./configure --with-webdav-locks
84+
libuuid-devel
85+
libxml2 # libxml2 ./configure --with-webdav-props
86+
libxml2-devel
87+
libxml2-static
88+
lua # Lua ./configure --with-lua
89+
lua-devel
90+
mariadb-devel # MariaDB ./configure --with-mysql
91+
mariadb-libs
92+
mbedtls # mbedTLS ./configure --with-mbedtls
93+
mbedtls-devel
94+
nettle # Nettle ./configure --with-nettle
95+
nettle-devel
96+
nss # NSS ./configure --with-nss
97+
nss-devel
98+
openldap # OpenLDAP ./configure --with-ldap
99+
openldap-devel
100+
openssl-devel # OpenSSL ./configure --with-openssl
101+
openssl-libs
102+
pam # PAM ./configure --with-pam
103+
pam-devel
104+
pcre # PCRE ./configure --with-pcre # (default)
105+
pcre-devel
106+
sqlite # SQLite ./configure --with-webdav-props
107+
sqlite-devel
108+
valgrind # valgrind ./configure --with-valgrind
109+
valgrind-devel
110+
zlib # zlib ./configure --with-zlib
111+
zlib-devel
112+
113+
more options: ./configure --help
114+
115+
re-run ./configure after installing packages
116+
117+
compile and install it with ::
118+
119+
$ cd lighttpd-1.4.xx
120+
$ ./autogen.sh # detect/use newer versions of autotools (if present)
121+
$ ./configure -C # add --with-xxxxx custom flags
122+
$ make
123+
# sudo make install
124+
125+
126+
Running Tests
127+
-------------
128+
129+
required packages to run test harness ::
130+
131+
(e.g. on Fedora 22, sudo dnf install ...)
132+
(e.g. on Arch Linux, sudo pacman ... (with lowercased package names))
133+
134+
perl-CGI
135+
perl-Digest
136+
perl-Digest-MD5
137+
perl-Encode-Locale
138+
perl-HTML-Entities-Interpolate
139+
perl-HTML-Parser
140+
perl-HTML-Tagset
141+
perl-HTTP-Date
142+
perl-HTTP-Message
143+
perl-IO-HTML
144+
perl-LWP-MediaTypes
145+
perl-Tie-Function
146+
perl-TimeDate
147+
php
148+
php-cgi
149+
150+
optional packages to run test harness ::
151+
152+
fcgi-devel
153+
154+
$ cd tests/ && make fcgi-auth fcgi-responder
155+
156+
run test harness
157+
158+
$ make check
159+
160+
run test harness with additional FastCGI tests (requires fcgi-devel package)
161+
162+
$ cd tests/ && make check-am
163+
164+
34165
static build using SCons
35166
------------------------
36167

README

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,22 @@ Network
3737
Protocols
3838
`````````
3939

40-
- HTTP/1.0 (http://www.ietf.org/rfc/rfc1945.txt)
41-
- HTTP/1.1 (http://www.ietf.org/rfc/rfc2616.txt)
42-
- HTTPS (provided by openssl)
43-
- CGI/1.1 (http://CGI-Spec.Golux.Com/)
40+
- HTTP/2 (https://tools.ietf.org/rfc/rfc7540.txt)
41+
- HTTP/1.1 (https://tools.ietf.org/rfc/rfc2616.txt)
42+
- HTTP/1.0 (https://tools.ietf.org/rfc/rfc1945.txt)
43+
- HTTPS (via one of openssl, BoringSSL, LibreSSL, mbedTLS, wolfSSL, GnuTLS, NSS)
44+
- CGI/1.1 (https://tools.ietf.org/html/rfc3875.txt)
4445
- FastCGI (http://www.fastcgi.com/devkit/doc/fcgi-spec.html)
4546

4647
Advanced Features
4748
`````````````````
4849

49-
- load-balanced FastCGI
50+
- load-balanced FastCGI, SCGI, reverse-proxy, socket proxy, websocket tunnel
5051
(one webserver distributes requests to multiple PHP-servers via FastCGI)
52+
- streaming FastCGI, SCGI, reverse-proxy, socket proxy, websocket tunnel
5153
- custom error pages (for Response-Code 400-599)
5254
- virtual hosts
5355
- directory listings
54-
- streaming CGI and FastCGI
5556
- URL-Rewriting
5657
- HTTP-Redirection
5758
- output-compression with transparent caching

tests/README

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Running tests
2+
-------------
3+
4+
$ make check
5+
6+
If run from tests/ dir, tests will fail to run tests if lighttpd not built.
7+
If run from top level, 'make' will build lighttpd exectuable if not yet built,
8+
and then will run tests.
9+
10+
11+
Running individual tests programs
12+
---------------------------------
13+
14+
prep
15+
$ cd tests/
16+
$ ./prepare.sh
17+
18+
then, for any particular *.t such as request.t,
19+
$ ./request.t
20+
or
21+
$ VERBOSE=1 RUNTESTS=request ./run-tests.pl
22+
23+
More information is output by tests with additional environment settings:
24+
$ TRACE_HTTP=1 ./request.t
25+
26+
See LightyTest.pm before trying TRACEME
27+
$ less LightyTest.pm
28+
29+
$ TRACEME=strace ./request.t # output to file 'strace'
30+
$ TRACEME=truss ./request.t # output to file 'strace'
31+
$ TRACEME=gdb ./request.t # not for interactive debugging (see below)
32+
$ TRACEME=valgrind ./request.t
33+
34+
To reduce noise from valgrind --show-leak-kinds=all (or =reachable), avoid FAM.
35+
Use server.stat-cache-engine = "simple" (not server.stat-cache-engine = "fam")
36+
in lighttpd.conf. (FAM creates /usr/libexec/gam_server as child process.)
37+
38+
39+
Running lighttpd server with a config from tests/*.conf
40+
-------------------------------------------------------
41+
42+
Each *.t loads the lighttpd server with one or more config files.
43+
See each *.t for which config file is used, e.g. tests/lighttpd.conf
44+
45+
To run a specific config
46+
repo=$PWD # from root of src repository
47+
cd tests/
48+
./prepare.sh
49+
PERL=/usr/bin/perl PHP=/usr/bin/php-cgi SRCDIR=$repo/tests \
50+
$repo/src/lighttpd -D -f lighttpd.conf -m $repo/src/.libs
51+
52+
The PERL, PHP, and SRCDIR environment variables are set by LightyTest.pm
53+
when 'make check' is run. PERL and PHP can be set to paths to perl and php,
54+
e.g. export PERL=/usr/bin/perl PHP=/usr/bin/php-cgi
55+
56+
To run a specific config under gdb
57+
repo=$PWD # from root of src repository
58+
cd tests/
59+
./prepare.sh
60+
PERL=/usr/bin/perl PHP=/usr/bin/php-cgi SRCDIR=$repo/tests repo=$repo \
61+
gdb $repo/src/lighttpd
62+
63+
(gdb) set args -D -f lighttpd.conf -m $repo/src/.libs
64+
(gdb) start
65+
(gdb) ...
66+
67+
68+
Hints and tips
69+
--------------
70+
Q: What do I do if tests fail with:
71+
bind: Address already in use at LightyTest.pm line 429.
72+
A: It is likely that something else on the machine is already using the port
73+
that tests are trying to use to run a backend. Try exiting out of your web
74+
browser and then run the tests again. (root can use 'netstat' or 'ss' to
75+
find out which process is using the port.)
76+
77+
78+
Additional documentation
79+
------------------------
80+
https://redmine.lighttpd.net/projects/lighttpd/wiki/RunningUnitTests
81+
https://redmine.lighttpd.net/projects/lighttpd/wiki/HowToReportABug
82+
https://redmine.lighttpd.net/projects/lighttpd/wiki/DebugVariables

0 commit comments

Comments
 (0)