Skip to contentSkip to conversation

lighttpd: use standard web root directory

PATCH New spdawson at gmail.com 2 participants 4 messages Jun 25, 2012 – Jun 26, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lighttpd: use standard web root directory

From: Simon Dawson <[email protected]>

The lighttpd package uses /srv/www as its web root directory; this sets it apart from other web-related packages in Buildroot, which all use /var/www as their web root directory.

---
 .../lighttpd-Fix-default-config-file.patch         |   52 +++++++++-----------
 package/lighttpd/lighttpd.mk                       |    2 +-
 2 files changed, 25 insertions(+), 29 deletions(-)
package/lighttpd/lighttpd-Fix-default-config-file.patch +24 -28
index 59ce907..d7900e9 100644
@@ -8,25 +8,34 @@ Modify the default lighttpd configuration file to have one a starting conf
   * Change the network backend to writev since linux-sendfile fails on buildroot
 
 Signed-off-by: Maxime Ripard <[email protected]>
----
- doc/config/conf.d/access_log.conf |    2 +-
- doc/config/lighttpd.conf          |   18 +++++++++---------
- 2 files changed, 10 insertions(+), 10 deletions(-)
 
-Index: lighttpd-1.4.30/doc/config/lighttpd.conf
-===================================================================
---- lighttpd-1.4.30.orig/doc/config/lighttpd.conf
-+++ lighttpd-1.4.30/doc/config/lighttpd.conf
-@@ -13,7 +13,7 @@
+diff -Nurp a/doc/config/conf.d/access_log.conf b/doc/config/conf.d/access_log.conf
+--- a/doc/config/conf.d/access_log.conf	2010-07-11 18:01:32.000000000 +0100
++++ b/doc/config/conf.d/access_log.conf	2012-06-25 15:20:29.053260085 +0100
+@@ -9,7 +9,7 @@ server.modules += ( "mod_accesslog" )
+ ##
+ ## Default access log.
+ ##
+-accesslog.filename          = log_root + "/access.log"
++accesslog.filename          = log_root + "/lighttpd-access.log"
+ 
+ ##
+ ## The default format produces CLF compatible output.
+diff -Nurp a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf
+--- a/doc/config/lighttpd.conf	2011-12-18 12:57:25.000000000 +0000
++++ b/doc/config/lighttpd.conf	2012-06-25 15:21:49.469256500 +0100
+@@ -13,8 +13,8 @@
  ## if you add a variable here. Add the corresponding variable in the
  ## chroot example aswell.
  ##
 -var.log_root    = "/var/log/lighttpd"
+-var.server_root = "/srv/www"
 +var.log_root    = "/var/log"
- var.server_root = "/srv/www"
++var.server_root = "/var/www"
  var.state_dir   = "/var/run"
  var.home_dir    = "/var/lib/lighttpd"
-@@ -90,7 +90,7 @@
+ var.conf_dir    = "/etc/lighttpd"
+@@ -90,7 +90,7 @@ server.port = 80
  ##
  ## Use IPv6?
  ##
@@ -35,7 +44,7 @@ Index: lighttpd-1.4.30/doc/config/lighttpd.conf
  
  ##
  ## bind to a specific IP
-@@ -101,8 +101,8 @@
+@@ -101,8 +101,8 @@ server.use-ipv6 = "enable"
  ## Run as a different username/groupname.
  ## This requires root permissions during startup. 
  ##
@@ -46,7 +55,7 @@ Index: lighttpd-1.4.30/doc/config/lighttpd.conf
  
  ## 
  ## enable core files.
-@@ -138,7 +138,7 @@
+@@ -138,7 +138,7 @@ server.pid-file = state_dir + "/lighttpd
  ##
  ## Path to the error log file
  ##
@@ -55,7 +64,7 @@ Index: lighttpd-1.4.30/doc/config/lighttpd.conf
  
  ##
  ## If you want to log to syslog you have to unset the 
-@@ -188,7 +188,7 @@
+@@ -188,7 +188,7 @@ server.event-handler = "linux-sysepoll"
  ## linux-sendfile - is recommended for small files.
  ## writev         - is recommended for sending many large files
  ##
@@ -64,7 +73,7 @@ Index: lighttpd-1.4.30/doc/config/lighttpd.conf
  
  ##
  ## As lighttpd is a single-threaded server, its main resource limit is
-@@ -311,9 +311,9 @@
+@@ -311,9 +311,9 @@ url.access-deny             = ( "~", ".i
  ## disable range requests for pdf files
  ## workaround for a bug in the Acrobat Reader plugin.
  ##
@@ -77,16 +86,3 @@ Index: lighttpd-1.4.30/doc/config/lighttpd.conf
  
  ##
  ## url handling modules (rewrite, redirect)
-Index: lighttpd-1.4.30/doc/config/conf.d/access_log.conf
-===================================================================
---- lighttpd-1.4.30.orig/doc/config/conf.d/access_log.conf
-+++ lighttpd-1.4.30/doc/config/conf.d/access_log.conf
-@@ -9,7 +9,7 @@
- ##
- ## Default access log.
- ##
--accesslog.filename          = log_root + "/access.log"
-+accesslog.filename          = log_root + "/lighttpd-access.log"
- 
- ##
- ## The default format produces CLF compatible output.
package/lighttpd/lighttpd.mk +1 -1
index c7fae32..0b75185 100644
@@ -59,7 +59,7 @@ endif
 define LIGHTTPD_INSTALL_CONFIG
 	mkdir -p $(TARGET_DIR)/etc/lighttpd
 	mkdir -p $(TARGET_DIR)/etc/lighttpd/conf.d
-	mkdir -p $(TARGET_DIR)/srv/www/htdocs
+	mkdir -p $(TARGET_DIR)/var/www/htdocs
 
 	[ -f $(TARGET_DIR)/etc/lighttpd/lighttpd.conf ] || \
 		$(INSTALL) -D -m 755 $(@D)/doc/config/lighttpd.conf \
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 lighttpd: use standard web root directory

Quoted 5 lines · spdawson at gmail.com

The lighttpd package uses /srv/www as its web root directory; this sets it apart from other web-related packages in Buildroot, which all use /var/www as their web root directory.

[snip]

Quoted 10 lines

-Index: lighttpd-1.4.30/doc/config/conf.d/access_log.conf
-===================================================================
---- lighttpd-1.4.30.orig/doc/config/conf.d/access_log.conf -+++ lighttpd-1.4.30/doc/config/conf.d/access_log.conf -@@ -9,7 +9,7 @@
- ##
- ## Default access log.
- ##
--accesslog.filename = log_root + "/access.log"
-+accesslog.filename = log_root + "/lighttpd-access.log"

Why is this removed?

package/lighttpd/lighttpd.mk endif · line 62

Quoted 13 lines
package/lighttpd/lighttpd-Fix-default-config-file.patch +0 -3
-
- ##
- ## The default format produces CLF compatible output.
package/lighttpd/lighttpd.mk +1 -1
index c7fae32..0b75185 100644
@@ -59,7 +59,7 @@ endif
  define LIGHTTPD_INSTALL_CONFIG
      mkdir -p $(TARGET_DIR)/etc/lighttpd
      mkdir -p $(TARGET_DIR)/etc/lighttpd/conf.d
-    mkdir -p $(TARGET_DIR)/srv/www/htdocs
+    mkdir -p $(TARGET_DIR)/var/www/htdocs

This seems to imply that the actual server root (i.e. what http://hostname/ is
pointing to) is /var/www/htdocs, not /var/www. So that's still different from the other packages. But I'm not familiar enough with lighttpd config to be sure.

Regards,
Arnout

Quoted 3 lines
package/lighttpd/lighttpd.mk +0 -0
      [ -f $(TARGET_DIR)/etc/lighttpd/lighttpd.conf ] || \
          $(INSTALL) -D -m 755 $(@D)/doc/config/lighttpd.conf \
Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH 1/1 lighttpd: use standard web root directory

Thanks for the comments Arnout.

Quoted 4 lines · Arnout Vandecappelle
Quoted 2 lines

--accesslog.filename ? ? ? ? ?= log_root + "/access.log" -+accesslog.filename ? ? ? ? ?= log_root + "/lighttpd-access.log"

?Why is this removed?

This was part of the original lighttpd "fix config file" patch, so I can't say what the motivation was. It certainly looks to be unnecessary.

Quoted 3 lines

?This seems to imply that the actual server root (i.e. what http://hostname/
is pointing to) is /var/www/htdocs, not /var/www. ?So that's still different from the other packages.

Well spotted; I'll fix my patch and resubmit.

#3 lore raw

PATCH 1/1 lighttpd: use standard web root directory

Quoted 4 lines · Arnout Vandecappelle
Quoted 2 lines

--accesslog.filename ? ? ? ? ?= log_root + "/access.log" -+accesslog.filename ? ? ? ? ?= log_root + "/lighttpd-access.log"

?Why is this removed?

Having thought about this, it looks like it was probably done in case some other package were to log to /var/log/access.log, which seems not unlikely. But elsewhere in the patch, the log root directory is changed from the default /var/log/lighttpd to /var/log; were this not changed, the log file rename would be unnecessary.

My intention is to leave this as it is for now: any other tinkering with the configuration should probably be done in a separate patch.