Configure multiple virtual hosts on apach2 local mac
I am trying to set up multiple virtual hosts on my local apache2 server. My goal is to go to "zf2-tutorial.localhost" in the browser for my Zend project and then go to "symfony.localhost" for my Symfony project. Right now, my Zend project is served whether I go to "zf2-tutorial.localhost" or "symfony.localhost". Here's part of my http.conf file
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot /Users/myusername/Sites/Zend/public
SetEnv APPLICATION_ENV "development"
<Directory /Users/myusername/Sites/Zend/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName symfony.localhost
DocumentRoot /Users/myusername/Sites/symfony
SetEnv APPLICATION_ENV "development"
ServerAlias www.symfony.localhost
</VirtualHost>
My hosts file ends with these two lines
127.0.0.1 zf2-tutorial.localhost localhost
127.0.0.1 symfony.localhost localhost
What am I doing wrong?
+3
source to share