Angelica Rosa Angelica Rosa - 9 months ago 71
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: 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
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

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 Source

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!