addsite: Add www users and groups in their own OU's.
[matthijs/servers/drsnuggles.git] / usr / local / bin / addsite
index c7212ab63b89c44d8a000515af9ed5537485f4ed..c0ecae848afa8d75c7593ea68fad33f5cac4474d 100755 (executable)
@@ -14,8 +14,8 @@ HTTPD_USERS_GID=1002
 # The template to copy
 TEMPLATE_DIR=/data/www/template
 # The bases to create users under
-USERBASE=ou=Users,dc=drsnuggles,dc=stderr,dc=nl
-GROUPBASE=ou=Groups,dc=drsnuggles,dc=stderr,dc=nl
+USERBASE="ou=Httpd Users,ou=Users,dc=drsnuggles,dc=stderr,dc=nl"
+GROUPBASE="ou=Domain Groups,ou=Groups,dc=drsnuggles,dc=stderr,dc=nl"
 # PHP config to change the error_log setting in
 PHP_CONFIG=conf/php.ini.override
 # PHP error logfile to set error_log to
@@ -92,14 +92,14 @@ sudo chown -R 0:$GROUP "$DIR"
 # 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 and conf
-sudo setfacl -R -m d:u:$HTTPD_USER:rX,u:$HTTPD_USER:rX "$DIR/htdocs" "$DIR/conf"
+# 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"