X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=usr%2Flocal%2Fbin%2Faddsite;h=9ef8ae46876253e7881b007541091e35d4df3897;hb=47aae9573917c701ea8548548d1fe2b0e9bc662f;hp=6c0749a3b495580b5dafd78cc877db171e9dcdee;hpb=a83e1fa60374fc899d2221344edf87c4b7698406;p=matthijs%2Fservers%2Fdrsnuggles.git diff --git a/usr/local/bin/addsite b/usr/local/bin/addsite index 6c0749a..9ef8ae4 100755 --- a/usr/local/bin/addsite +++ b/usr/local/bin/addsite @@ -1,5 +1,10 @@ #!/bin/sh +if [ "$UID" -eq 0 ]; then + echo "No need to run as root." + exit 1 +fi + if [ "$1" = "-h" -o "$1" = "--help" -o $# -ne 1 ]; then echo "Usage $0 " echo " is the full path to the site, such as /var/www/example.nl" @@ -118,11 +123,14 @@ sudo setfacl -m u:$SCRIPT_USER:rwX "$DIR/logs" "$DIR/data" sudo sh -c "chown -R $SCRIPT_USER \"$DIR\"/logs/php.log* \"$DIR\"/logs/wipi.log*" sudo sh -c "chown -R $HTTPD_USER \"$DIR\"/logs/access.log*" -# Now, set the error_log setting in php.ini +# Now, set the error_log setting in php.ini. This ensures each domein will have +# a separate logfile for errors, since lighttpd only supports a single error +# log (When error_log is not set, error messages will go to lighttpd's log +# automatically). echo Updating `basename $PHP_CONFIG` - sudo sed -i "s#^error_log *=.*#error_log = $DIR/$PHP_ERRORLOG#" "$DIR/$PHP_CONFIG" +sudo update-php.ini # Done!