Created
March 26, 2014 20:33
-
-
Save m-maranan/9792708 to your computer and use it in GitHub Desktop.
Create a Virtual Host for a New Site
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 | |
| # run with sudo create_vhost | |
| # replace {path to public} eg /var/www/laravel/public | |
| # Create the file with VirtualHost configuration in /etc/apache2/site-available/ | |
| echo "<VirtualHost *:80> | |
| DocumentRoot {path to public} | |
| ServerName lawfirmrater.dev | |
| <Directory {path to public}> | |
| Options +Indexes +FollowSymLinks +MultiViews +Includes | |
| AllowOverride All | |
| Order allow,deny | |
| allow from all | |
| </Directory> | |
| </VirtualHost>" > /etc/apache2/sites-available/lawfirmrater.dev.conf | |
| # Add the host to the hosts file | |
| echo 127.0.0.1 lawfirmrater.dev >> /etc/hosts | |
| # Enable the site | |
| a2ensite lawfirmrater.dev | |
| # Reload Apache2 | |
| /etc/init.d/apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment