Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 1 | Modify 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 | |
| 10 | Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 11 | Signed-off-by: Simon Dawson <spdawson@gmail.com> |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 12 | |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 13 | diff -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. |
| 25 | diff -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 Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 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" |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 33 | -var.server_root = "/srv/www" |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 34 | +var.log_root = "/var/log" |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 35 | +var.server_root = "/var/www" |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 36 | var.state_dir = "/var/run" |
| 37 | var.home_dir = "/var/lib/lighttpd" |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 38 | var.conf_dir = "/etc/lighttpd" |
| 39 | @@ -90,7 +90,7 @@ server.port = 80 |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 40 | ## |
| 41 | ## Use IPv6? |
| 42 | ## |
| 43 | -server.use-ipv6 = "enable" |
| 44 | +# server.use-ipv6 = "enable" |
| 45 | |
| 46 | ## |
| 47 | ## bind to a specific IP |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 48 | @@ -101,8 +101,8 @@ server.use-ipv6 = "enable" |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 49 | ## Run as a different username/groupname. |
| 50 | ## This requires root permissions during startup. |
| 51 | ## |
| 52 | -server.username = "lighttpd" |
| 53 | -server.groupname = "lighttpd" |
Floris Bos | 357d0c9 | 2015-04-30 18:12:16 +0200 | [diff] [blame] | 54 | +server.username = "www-data" |
| 55 | +server.groupname = "www-data" |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 56 | |
| 57 | ## |
| 58 | ## enable core files. |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 59 | @@ -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 Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 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 |
Simon Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 77 | @@ -188,7 +188,7 @@ server.event-handler = "linux-sysepoll" |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 78 | ## 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 Dawson | 853545c | 2012-07-21 19:47:51 +0100 | [diff] [blame] | 86 | @@ -311,9 +311,9 @@ url.access-deny = ( "~", ".i |
Maxime Ripard | b52a982 | 2012-04-20 04:04:20 +0000 | [diff] [blame] | 87 | ## 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) |