blob: bffc2a8ed3703d7e499eb8377c859b8cd59fb3c4 [file] [log] [blame]
Maxime Ripardb52a9822012-04-20 04:04:20 +00001Modify 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 * Disable pdf ranges fix for Adobe Reader since it uses regex and we
7 don't always have pcre support
8 * Change the network backend to writev since linux-sendfile fails on buildroot
9
10Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Simon Dawson853545c2012-07-21 19:47:51 +010011Signed-off-by: Simon Dawson <spdawson@gmail.com>
Maxime Ripardb52a9822012-04-20 04:04:20 +000012
Simon Dawson853545c2012-07-21 19:47:51 +010013diff -Nurp a/doc/config/conf.d/access_log.conf b/doc/config/conf.d/access_log.conf
14--- a/doc/config/conf.d/access_log.conf 2010-07-11 18:01:32.000000000 +0100
15+++ b/doc/config/conf.d/access_log.conf 2012-07-21 19:37:58.453207990 +0100
16@@ -9,7 +9,7 @@ server.modules += ( "mod_accesslog" )
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 -Nurp a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf
26--- a/doc/config/lighttpd.conf 2011-12-18 12:57:25.000000000 +0000
27+++ b/doc/config/lighttpd.conf 2012-07-21 19:40:45.281200552 +0100
28@@ -13,8 +13,8 @@
Maxime Ripardb52a9822012-04-20 04:04:20 +000029 ## if you add a variable here. Add the corresponding variable in the
30 ## chroot example aswell.
31 ##
32-var.log_root = "/var/log/lighttpd"
Simon Dawson853545c2012-07-21 19:47:51 +010033-var.server_root = "/srv/www"
Maxime Ripardb52a9822012-04-20 04:04:20 +000034+var.log_root = "/var/log"
Simon Dawson853545c2012-07-21 19:47:51 +010035+var.server_root = "/var/www"
Maxime Ripardb52a9822012-04-20 04:04:20 +000036 var.state_dir = "/var/run"
37 var.home_dir = "/var/lib/lighttpd"
Simon Dawson853545c2012-07-21 19:47:51 +010038 var.conf_dir = "/etc/lighttpd"
39@@ -90,7 +90,7 @@ server.port = 80
Maxime Ripardb52a9822012-04-20 04:04:20 +000040 ##
41 ## Use IPv6?
42 ##
43-server.use-ipv6 = "enable"
44+# server.use-ipv6 = "enable"
45
46 ##
47 ## bind to a specific IP
Simon Dawson853545c2012-07-21 19:47:51 +010048@@ -101,8 +101,8 @@ server.use-ipv6 = "enable"
Maxime Ripardb52a9822012-04-20 04:04:20 +000049 ## Run as a different username/groupname.
50 ## This requires root permissions during startup.
51 ##
52-server.username = "lighttpd"
53-server.groupname = "lighttpd"
Floris Bos357d0c92015-04-30 18:12:16 +020054+server.username = "www-data"
55+server.groupname = "www-data"
Maxime Ripardb52a9822012-04-20 04:04:20 +000056
57 ##
58 ## enable core files.
Simon Dawson853545c2012-07-21 19:47:51 +010059@@ -112,7 +112,7 @@ server.groupname = "lighttpd"
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@@ -138,7 +138,7 @@ server.pid-file = state_dir + "/lighttpd
Maxime Ripardb52a9822012-04-20 04:04:20 +000069 ##
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
Simon Dawson853545c2012-07-21 19:47:51 +010077@@ -188,7 +188,7 @@ server.event-handler = "linux-sysepoll"
Maxime Ripardb52a9822012-04-20 04:04:20 +000078 ## linux-sendfile - is recommended for small files.
79 ## writev - is recommended for sending many large files
80 ##
81-server.network-backend = "linux-sendfile"
82+server.network-backend = "writev"
83
84 ##
85 ## As lighttpd is a single-threaded server, its main resource limit is
Simon Dawson853545c2012-07-21 19:47:51 +010086@@ -311,9 +311,9 @@ url.access-deny = ( "~", ".i
Maxime Ripardb52a9822012-04-20 04:04:20 +000087 ## disable range requests for pdf files
88 ## workaround for a bug in the Acrobat Reader plugin.
89 ##
90-$HTTP["url"] =~ "\.pdf$" {
91- server.range-requests = "disable"
92-}
93+# $HTTP["url"] =~ "\.pdf$" {
94+# server.range-requests = "disable"
95+# }
96
97 ##
98 ## url handling modules (rewrite, redirect)