Skip to content

Instantly share code, notes, and snippets.

View jgdev's full-sized avatar
🏠
Working from home

Joan Peralta jgdev

🏠
Working from home
View GitHub Profile
#!/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