Created
May 24, 2014 14:33
-
-
Save innesm4/150d5de32b2ab983b8a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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