Angelica Rosa Angelica Rosa - 1 month ago 16
Apache Configuration Question

Apache VirtualHost and localhost

I'm working with XAMPP on Mac OS X.
I'm trying to run properly a symfony website for a client, i really don't know (yet) symfony, i just want to install and launch it.

I've changed my etc/hosts this way:

127.0.0.1 www.mysite.local


and the httpd.conf this way:

<VirtualHost *:80>
ServerName www.mysite.local
DocumentRoot /Applications/MAMP/htdocs/mysite/web
DirectoryIndex index.php
<Directory /Applications/MAMP/htdocs/mysite/web>
AllowOverride All
Allow from All
</Directory>
Alias /sf /Applications/MAMP/htdocs/mysite/lib/vendor/symfony/data/web/sf
<Directory "/Applications/MAMP/htdocs/mysite/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>


Now, the site is working (yay!), but i can't access anymore none of my other local sites because localhost
is rendered as www.mysite.local.
Where i'm wrong?

Thank you!

Answer

This is normal if you see it. Since it is the first virtual host entry it will show local host.

Lets say for example you didn't want that page to show. All you want to show is apache it works page so you would make a vhost entry before mysite.local as local host and point it to the it works page.

But this is normal. I had this problem before so don't worry!