Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I can't get a specific virtual host to work. This is the first part of my httpd-vhosts.conf file:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "/Volumes/Data RAID/htdocs/Symfony/web"
    ServerName framework.loc
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Volumes/Data RAID/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Volumes/Data RAID/htdocs/AmColAn"
    ServerName amcolan.loc
</VirtualHost>

It's the first one that fails. The others work fine. I can get to index.php using:

http://localhost/symfony/web/index.php

I can't get to it using:

http://framework.loc/index.php

I get redirected to OpenDNS, which I use as my DNS, with the error that it is not loading. This is on OS X 10.8.2. I restart apache every time I change the config. I must be making some sort of bonehead error.

share|improve this question
1  
This sounds like you haven't set the appropriate entry in your DNS (HOSTS) file? But you suggest the last one (amcolan.loc) is working OK? –  w3d Mar 23 '13 at 2:43
    
Yes, amcolan.loc works as well as several others in the same format I didn't show. –  curt Mar 23 '13 at 3:32
1  
You were right. I forgot to update the hosts file. If you post it as an answer, I'll accept it. –  curt Mar 23 '13 at 3:38
add comment

1 Answer 1

up vote 1 down vote accepted

As mentioned in comments, an appropriate entry needs to also be set in DNS (ie. local HOSTS file) that points the domain framework.loc to the webserver.

For example:

127.0.0.1  framework.loc

This appears to have been missing/incorrect in this instance.

share|improve this answer
    
Thanks for reminding me about the hosts file. If I don't do things like this on a regulars basis, I forget some of the steps. –  curt Mar 23 '13 at 15:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.