Last active
September 24, 2015 02:47
-
-
Save harikt/656142 to your computer and use it in GitHub Desktop.
Virtual host
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
Replace the blog and public directory according to the names . | |
Sample which Ryan Mauger http://www.rmauger.co.uk/ helped me on #zf-talk . | |
<Bittarman> open your terminal, and type this, | |
sudo echo "127.0.0.1 blog.local www.blog.local" >> /etc/hosts | |
<Bittarman> then, sudo vim /etc/apache2/sites-available/blog.local | |
<Bittarman> and paste this into it http://pastie.org/1112846 | |
<VirtualHost *:80> | |
ServerName blog.local | |
ServerAlias www.blog.local | |
DocumentRoot /var/www/blog/public | |
<Directory /var/www/blog/public> | |
AllowOverride All | |
</directory> | |
</VirtualHost> | |
<Bittarman> replacing /var/www/blog/public with the path to your public dir | |
<Kit-10> (thanks Bittarman for helping resolve this) | |
<Bittarman> then, sudo a2ensite blog.local && sudo apache2ctl restart | |
<Bittarman> and finally, you will probably need sudo a2enmod rewrite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache 2.4 settings for virtual host .
/etc/apache2/sites-available/hello.localhost.conf
, depending upon how the conf is read.Add in
/etc/hosts