Last active
July 23, 2017 16:46
-
-
Save ferndot/601efae6f8984ea5eb2c08201512c6b6 to your computer and use it in GitHub Desktop.
Creates a website on apache.
This file contains 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
cd /var/www/ | |
sudo mkdir -p /var/www/$1/public_html | |
sudo ./perms.sh $1 | |
echo "Success!" >> /var/www/$1/public_html/index.html | |
vHostFile=/etc/apache2/sites-available/$1.conf | |
sudo echo "<VirtualHost *:80>" >> $vHostFile | |
sudo echo -e "\tServerName $1" >> $vHostFile | |
sudo echo -e "\tServerAlias www.$1" >> $vHostFile | |
sudo echo -e "\tServerAdmin josh@204.44.81.119" >> $vHostFile | |
sudo echo -e "\tDocumentRoot /var/www/$1/public_html" >> $vHostFile | |
sudo echo -e '\tErrorLog ${APACHE_LOG_DIR}/error.log' >> $vHostFile | |
sudo echo -e '\tCustomLog ${APACHE_LOG_DIR}/access.log combined' >> $vHostFile | |
sudo echo "</VirtualHost>" >> $vHostFile | |
sudo a2ensite $1.conf | |
sudo service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment