Created
February 6, 2011 03:45
-
-
Save jcartledge/813108 to your computer and use it in GitHub Desktop.
UBUNTU: Quickly set up a named vhost to serve the directory you are in
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 | |
sudo sh -c "echo \"127.0.0.1 $1\" >> /etc/hosts" | |
DIR=`pwd` | |
sudo sh -c "echo \"<VirtualHost *:80> | |
ServerName $1 | |
DocumentRoot $DIR | |
</VirtualHost>\" > /etc/apache2/sites-available/$1" | |
sudo a2ensite $1 | |
sudo /etc/init.d/apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment