lighttpd: Add initial configuration files.
[matthijs/servers/drsnuggles.git] / usr / local / bin / addsite
index 44d39b88cbfced4143504c629dcb6e01faa381dc..c7212ab63b89c44d8a000515af9ed5537485f4ed 100755 (executable)
@@ -21,7 +21,10 @@ PHP_CONFIG=conf/php.ini.override
 # PHP error logfile to set error_log to
 PHP_ERRORLOG=logs/php.log
 
-DIR=$1
+# Get dir, but make it absolute
+cd "$1"
+DIR=`pwd`
+
 
 if [ -e "$DIR" -a ! -d "$DIR" ]; then
        echo "$DIR" must be a directory, or not exist yet.
@@ -95,8 +98,8 @@ sudo setfacl -R -m g::rwX "$DIR/htdocs" "$DIR/conf"
 # Give lighttpd read access to the dir itself
 sudo setfacl -m u:$HTTPD_USER:rx "$DIR"
 
-# Allow lighttpd to read anything in htdocs
-sudo setfacl -R -m d:u:$HTTPD_USER:rX,u:$HTTPD_USER:rX "$DIR/htdocs"
+# Allow lighttpd to read anything in htdocs and conf
+sudo setfacl -R -m d:u:$HTTPD_USER:rX,u:$HTTPD_USER:rX "$DIR/htdocs" "$DIR/conf"
 
 # Allow lighttpd to write new files in logs (but not touch existing or those created by lighttpd)
 sudo setfacl -m u:$HTTPD_USER:rwX "$DIR/logs"