Guest User

Untitled

a guest
Mar 21st, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ -z "$1" ]
  4. then
  5. echo "Usage: setup-vhost <hostname> (without the www. prefix)"
  6. exit
  7. fi
  8.  
  9.  
  10. mkdir "/var/www/$1"
  11.  
  12. cat > "/etc/nginx/conf.d/$1.conf" <<END
  13. server {
  14. server_name $1 www.$1;
  15. root /var/www/$1;
  16. include php;
  17. access_log /var/www/$1-access.log;
  18. error_log /var/www/$1-error.log;
  19.  
  20.  
  21.  
  22. }
  23. END
  24. service nginx reload
  25.  
  26. echo vhost created, upload files to /var/www/$1
Advertisement
Add Comment
Please, Sign In to add comment