lighttpd: create user http and run as http by default
authorW. Michael Petullo <mike@flyn.org>
Sun, 21 Sep 2014 21:33:47 +0000 (17:33 -0400)
committerW. Michael Petullo <mike@flyn.org>
Sun, 21 Sep 2014 21:33:47 +0000 (17:33 -0400)
Signed-off-by: W. Michael Petullo <mike@flyn.org>
net/lighttpd/files/lighttpd.conf
net/lighttpd/files/lighttpd.init

index 378e32ae13eb7702fc81e5b674016a99518fca96..a52d08f6df1b2bf82bcd09c282ea601d7a3c0cc5 100644 (file)
@@ -13,8 +13,8 @@ server.document-root        = "/www"
 server.upload-dirs          = ( "/tmp" )
 server.errorlog             = "/var/log/lighttpd/error.log"
 server.pid-file             = "/var/run/lighttpd.pid"
-#server.username             = "www-data"
-#server.groupname            = "www-data"
+server.username             = "http"
+server.groupname            = "www-data"
 #server.tag                  = "lighttpd"
 #server.errorlog-use-syslog  = "enable"
 #server.network-backend      = "write"
index d73a5da98da4ad61401720939da85480f30d5266..936c7f6c778914aa15e6527e7b9152e8d2f6fa93 100644 (file)
@@ -6,7 +6,11 @@ SERVICE_USE_PID=1
 START=50
 
 start() {
-       mkdir -m 0755 -p /var/log/lighttpd
+       user_exists http || user_add http
+       [ -d /var/log/lighttpd ] || {
+               mkdir -m 0775 -p /var/log/lighttpd
+               chgrp www-data /var/log/lighttpd
+       }
        service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
 }