Created
July 16, 2009 15:44
-
-
Save kogakure/148482 to your computer and use it in GitHub Desktop.
Bash: Symlink on project website
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/sh | |
| # | |
| # Create a VHost for Apache on Mac OSX and create a symlink to the project root. | |
| # Usage: "sudo vhost_symlink domain.suffix" | |
| ME=<username> | |
| SITES=/Users/$ME/Sites | |
| PROJECTS=/Users/$ME/<Projects/Customers> | |
| VHOST=/etc/apache2/extra/httpd-vhosts.conf | |
| echo "\n<VirtualHost *:80>" >> $VHOST | |
| echo " ServerAdmin <[email protected]>" >> $VHOST | |
| echo " DocumentRoot \"$SITES/$1\"" >> $VHOST | |
| echo " ServerName $1.dev" >> $VHOST | |
| echo "</VirtualHost>\n" >> $VHOST | |
| echo "127.0.0.1 $1.dev" >> /etc/hosts | |
| cd $SITES | |
| ln -s $PROJECTS/$1/<Website>/ $1 | |
| apachectl graceful |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment