# 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.
# By default, let the owner have write access, the group have read access
sudo setfacl -R --set d:u::rwX,d:g::rX,d:o::-,u::rwX,g::rX,o::- "$DIR"
-# Give the group write access to htdocs and conf
-sudo setfacl -R -m g::rwX "$DIR/htdocs" "$DIR/conf"
+# Give the group write access to htdocs, applications and conf
+sudo setfacl -R -m g::rwX "$DIR/htdocs" "$DIR/applications" "$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, applications and conf
+sudo setfacl -R -m d:u:$HTTPD_USER:rX,u:$HTTPD_USER:rX "$DIR/htdocs" "$DIR/applications" "$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"