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 webmaster@dummy-host2.example.com
    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.

Cody Covey
  • 101
  • 1

2 Answers2

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
xofer
  • 3,052
  • 12
  • 19
0

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

ramruma
  • 2,730
  • 1
  • 14
  • 8