Skip to content

Instantly share code, notes, and snippets.

@chriscoderdr
Created September 2, 2014 17:51
Show Gist options
  • Save chriscoderdr/5d15d00a5a08960aec08 to your computer and use it in GitHub Desktop.
Save chriscoderdr/5d15d00a5a08960aec08 to your computer and use it in GitHub Desktop.
#!/bin/bash
DOMAIN=$1
mkdir "/var/websites/$1"
cp "/var/websites/dummy/index.html" "/var/websites/$1/index.html"
touch "/etc/nginx/sites-available/$1"
ln -s "/etc/nginx/sites-available/$1" "/etc/nginx/sites-enabled"
cp "/root/server-config.conf" "/etc/nginx/sites-available/$1"
sed -i "s/DOMAIN/$DOMAIN/g" "/etc/nginx/sites-available/$1"
service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment