0

I am trying to set up virtual hosts on apache2 set up via WAMP. I have set the below code in the vhosts.conf file

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/wamp/www/inspection/"
    ServerName inspection
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

The trouble is when I go to inspection it takes me to the WAMP document root not the root of the inspection folder like specified in the DocumentRoot section above.

Where am I going wrong above. I also didn't know if it maybe something overriding it in the httpd.conf file. Any help is much appreciated.

EDIT: I uncommented the include line in httpd.conf which I hadn't seen to do before and now it points to the right place but if I attempt to use the submit button which takes me to http://inspection/confirm.php. In IE it says Cannot display the page and Chrome says no data was transmitted. If I go back to no vhosts it works fine.

2
  • You realize you misspelled inspection in your pasted configuration? Jul 16, 2012 at 17:57
  • fixed the spelling but that wasn't the issue.
    – Cody Covey
    Jul 16, 2012 at 18:00

2 Answers 2

1

Make sure that you have:

  • a NameVirtualHost line in your conf somewhere before the <VirtualHost... block (i.e. directly above it in the same file) and that the server name and port (*:80) match
  • an entry in the hosts file for inspection so that http://inspection/ resolves to your localhost (127.0.0.1)
  • cleared your browser's cache and cookies
  • restarted Apache
0

Put an actual IP address where you have *:80, and also have a Listen directive for that same IP address.

Not the answer you're looking for? Browse other questions tagged .