vkloss — 2013-06-03T19:03:29-04:00 — #1
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.
ralphm — 2013-06-03T20:28:15-04:00 — #2
Hi vkloss. Welcome to the forums.
This is not my area, but I did find this link helpful a while back, so am posting in case it helps you: http://sawmac.com/xampp/virtualhosts/
imouto — 2013-06-03T23:25:34-04:00 — #3
I've only ever used XAMPP and MAMP, but I'll assume WampServer is very similar. A few things I see that might need tweaking:
- In your httpd-vhosts.conf, you shouldn't even need this part:
http://localhost should just work without that part. For your testSite, try this instead in httpd-vhosts.conf:
Options Indexes FollowSymLinks Includes ExecCGI
Allow from all
- 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.
dklynn — 2013-06-05T06:30:51-04:00 — #4
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).