Previous Entry Share Next Entry
addwwwuser, fixpriv, ngensite
Strawberry
sanmai
# cat /usr/local/bin/addwwwuser
#!/bin/sh
: ${1?"Usage: $0 example.com"}

host=$1;

useradd -G crontab -m $host
mkdir -p /home/$host/www/htdocs /home/$host/www/logs
chown -R $host:$host /home/$host/ 
setfacl -m user:www-data:--x /home/$host /home/$host/www
setfacl -R -m d:u:www-data:rX /home/$host/www/htdocs
# cat /usr/local/bin/fixpriv
#!/bin/sh
: ${1?"Usage: $0 example.com"}

host=$1;

mkdir -p /home/$host/www/htdocs /home/$host/www/logs
chown -R $host:$host /home/$host/ 
chmod 700 /home/$host/
setfacl -m user:www-data:--x /home/$host /home/$host/www
setfacl -R -m d:u:www-data:rX /home/$host/www/htdocs
# cat /usr/local/bin/ngensite
#!/bin/sh
: ${1?"Usage: $0 sites-available/example.com"}

cd /etc/nginx/sites-enabled
site="../$1";

if [ ! -f "$site" ]; 
then echo File "$site" does not exists; exit 1; fi

ln -vs "$site"

Рекомендую к ознакомлению:


?

Log in

No account? Create an account