Mobile app version of vmapp.org
Login or Join
Karen161

: Can't Get a Virtual Host to Work 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

@Karen161

Posted in: #Apache2 #Virtualhost

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:
localhost/symfony/web/index.php

I can't get to it using:
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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme