Skip to content

Instantly share code, notes, and snippets.

@innesm4
Created May 24, 2014 14:33
Show Gist options
  • Select an option

  • Save innesm4/150d5de32b2ab983b8a8 to your computer and use it in GitHub Desktop.

Select an option

Save innesm4/150d5de32b2ab983b8a8 to your computer and use it in GitHub Desktop.
#!/bin/bash
clear
echo "YOU MUST NOT BE LOGGED IN AS ROOT WHEN RUNNING THIS SCRIPT as the owner of the folder will be Root"
echo "Domain name to set up: "
read domainname
cd /etc/apache2/sites-available
clear
sed s/DOMAIN/$domainname/g template > $domainname
if [ ! -d "/srv/logs" ]; then
mkdir /srv/logs
fi
mkdir /srv/www/$domainname
mkdir /srv/www/$domainname/web
mkdir /srv/www/$domainname/cgi-bin
touch /srv/www/$domainname/web/index.html
chown -R www-data.www-data /srv/www/$domainname
a2ensite $domainname
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment