Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ -z "$1" ]
- then
- echo "Usage: setup-vhost <hostname> (without the www. prefix)"
- exit
- fi
- mkdir "/var/www/$1"
- cat > "/etc/nginx/conf.d/$1.conf" <<END
- server {
- server_name $1 www.$1;
- root /var/www/$1;
- include php;
- access_log /var/www/$1-access.log;
- error_log /var/www/$1-error.log;
- }
- END
- service nginx reload
- echo vhost created, upload files to /var/www/$1
Advertisement
Add Comment
Please, Sign In to add comment