xref: /OK3568_Linux_fs/buildroot/package/lighttpd/0001-Fix-default-config-file.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Modify the default lighttpd configuration file to have one a starting conf
2
3  * Changed the log path to /var/log and logs filenames
4  * Disable IPv6
5  * Do not setuid to a user that doesn't exist on the system
6  * Change the network backend to writev since linux-sendfile fails on buildroot
7
8Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
9Signed-off-by: Simon Dawson <spdawson@gmail.com>
10[Gustavo: update for 1.4.37]
11Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
12
13diff -Nura lighttpd-1.4.37.orig/doc/config/conf.d/access_log.conf lighttpd-1.4.37/doc/config/conf.d/access_log.conf
14--- lighttpd-1.4.37.orig/doc/config/conf.d/access_log.conf	2015-09-01 14:38:48.684673663 -0300
15+++ lighttpd-1.4.37/doc/config/conf.d/access_log.conf	2015-09-01 14:38:53.975855142 -0300
16@@ -9,7 +9,7 @@
17 ##
18 ## Default access log.
19 ##
20-accesslog.filename          = log_root + "/access.log"
21+accesslog.filename          = log_root + "/lighttpd-access.log"
22
23 ##
24 ## The default format produces CLF compatible output.
25diff -Nura lighttpd-1.4.37.orig/doc/config/lighttpd.conf lighttpd-1.4.37/doc/config/lighttpd.conf
26--- lighttpd-1.4.37.orig/doc/config/lighttpd.conf	2015-09-01 14:38:48.684673663 -0300
27+++ lighttpd-1.4.37/doc/config/lighttpd.conf	2015-09-01 14:39:40.256442492 -0300
28@@ -13,8 +13,8 @@
29 ## if you add a variable here. Add the corresponding variable in the
30 ## chroot example aswell.
31 ##
32-var.log_root    = "/var/log/lighttpd"
33-var.server_root = "/srv/www"
34+var.log_root    = "/var/log"
35+var.server_root = "/var/www"
36 var.state_dir   = "/run"
37 var.home_dir    = "/var/lib/lighttpd"
38 var.conf_dir    = "/etc/lighttpd"
39@@ -90,7 +90,7 @@
40 ##
41 ## Use IPv6?
42 ##
43-server.use-ipv6 = "enable"
44+# server.use-ipv6 = "enable"
45
46 ##
47 ## bind to a specific IP
48@@ -101,8 +101,8 @@
49 ## Run as a different username/groupname.
50 ## This requires root permissions during startup.
51 ##
52-server.username  = "lighttpd"
53-server.groupname = "lighttpd"
54+server.username  = "www-data"
55+server.groupname = "www-data"
56
57 ##
58 ## Enable lighttpd to serve requests on sockets received from systemd
59@@ -118,7 +118,7 @@
60 ##
61 ## Document root
62 ##
63-server.document-root = server_root + "/htdocs"
64+server.document-root = server_root
65
66 ##
67 ## The value for the "Server:" response field.
68@@ -144,7 +144,7 @@
69 ##
70 ## Path to the error log file
71 ##
72-server.errorlog             = log_root + "/error.log"
73+server.errorlog             = log_root + "/lighttpd-error.log"
74
75 ##
76 ## If you want to log to syslog you have to unset the
77@@ -195,7 +195,7 @@
78 ## sendfile       - is recommended for small files.
79 ## writev         - is recommended for sending many large files
80 ##
81-server.network-backend = "sendfile"
82+server.network-backend = "writev"
83
84 ##
85 ## As lighttpd is a single-threaded server, its main resource limit is
86