I know it’s essentially pretty straight forward setting up virtual hosts, but I must be missing something, because for the last 5 hours, I cannot for the life of me get it working.
Here’s what I’ve done:
Editted httpd.conf by uncommenting the httpd-vhosts.conf line
Created two <virtual host> containers in the httpd-vhosts.conf file, like so:
Edited the hosts.txt by adding the following line: 127.0.0.1 testSite.local
It all seems so straight forward, except that it doesn’t work! It says server not found when I go to testSite.local. Localhost works fine and the WampServer is green (though it says offline).
Please can somebody point me in the right direction! I’ve been reading the same suggestions all day and they don’t seem to apply to my particular issue.
<Directory "C:/wamp/www/testSite">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I’m not sure what version of Windows you’re running, but your hosts file shouldn’t have the .txt file extension. It should just be hosts. In Vista it’s usually located at Windows\System32\drivers\etc. To edit it you have to run your text editor as an Administrator. You will probably also have to modify the Properties of the hosts file so that “Read-only” isn’t checked off. After you change your hosts file, make sure to checkmark “Read-only” back.
The thing that jumped out of your post at me was the “hosts.txt” file. hosts is an extensionless file located in the Windows (i.e., protected) directory so, if you’re using any Windows more advanced than XP, you’ll need to run your text editor (NOT Notepad) as the administrator so you can save the file (it will not save if not done as the administrator). With that, I think you’re set (leave the virtual host definitions in the extras/httpd-vhosts.conf file, though, IMHO).