bradical1379 — 2011-11-22T22:07:30-05:00 — #1
I am running into some problems with my virtual hosts set up on my local machine. I am running Windows 7 and Apache 2.2 on the machine.
This is my hosts file C:\Windows\System32\drivers\etc\hosts :
# For example:
# 18.104.22.168 rhino.acme.com # source server
# 22.214.171.124 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
This is my httpd-vhosts.conf file:
# Virtual Hosts
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# Use name-based virtual hosting.
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
CustomLog "logs/dummy-host.localhost-access.log" common
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
CustomLog "logs/dummy-host2.localhost-access.log" common
The issue that testsite and localhost have become the same thing. I can goto http://testsite/test to access the same thing as http://localhost/test
dklynn — 2011-11-24T21:32:14-05:00 — #2
Where did you install WAMP?
I've always advised NOT installing (individual WAMP apps) in a Win7-protected directory as you MUST save files there as the Administrator - not worth the effort.
What about the httpd.conf file? Were you successful in removing the comment to enable including the httpd-vhosts.conf?
I didn't see a syntax problem with your code and must assume that Apache is loading so that's verification.
bradical1379 — 2011-11-24T21:40:53-05:00 — #3
I am not using a pre-packaged WAMP version like wampserver, rather using stand alone installs of Apache, MySQL and PHP and my Windows & machine.
C:\Program Files\Apache Software Foundation\Apache2.2
Hopefully that makes sense.
Thanks for your help David.
dklynn — 2011-11-25T01:23:47-05:00 — #4
Program Files is the problem because you have to make all your edits of the files there as Administrator. I learned that the hard way and have yet to look back after installing everything (except MySQL) on the W: drive (partition - far, far away from any WinDoze-protected file.
If you don't believe me, take a look at the httpd.conf and httpd-vhosts.conf and see if they have the edits you made. Have a look at the files located within the htdocs directory, too.
It's nice that M$ is finally taking security seriously but they make it a real PITA the way they've implemented it.