Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After changing the VirtualHost setting on httpd-vhosts.conf in my wampserver like this

<VirtualHost *:80>
     DocumentRoot “C:/wamp/www/project”
     ServerName project.dev
<VirtualHost *:80>

I cannot access my default index page of wamp. I got my project.dev homepage when I only type `http://localhost'.

Did I do something wrong when setup the virtual host?

share|improve this question
add comment

migrated from stackoverflow.com Jan 22 '13 at 8:38

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 0 down vote accepted

Check your httpd-vhosts.conf file (and other config file that you have put virtual host configs) to make sure that the first virtual host has the DocumentRoot is your default www folder.

In most case, adding this configuration on top of your httpd-vhosts.conf may helps:

<VirtualHost *:80>
     DocumentRoot “path/to/your/www/folder”
</VirtualHost>
share|improve this answer
    
Thank you, it works, can you explain why it happened? –  Khac Phong Bui Jan 21 '13 at 23:00
add comment

Your WAMP now knows what it should do when a request for project.dev comes in, but your computer still has no idea what is project.dev. To tell it, you need to edit your hosts file (it's located in something like C:\Windows\System32\Drivers\etc for Windows XP), and add this at the bottom.

127.0.0.1      project.dev

After this, your domain should be working.

share|improve this answer
    
Thank you, but my domain still works. My proplem is the localhost still point to the new "domain". –  Khac Phong Bui Jan 21 '13 at 23:07
    
I assume you mean your computer resolves to project.dev, i.e., points to localhost. You never change localhost to anything in your resolver. –  chris Jan 21 '13 at 23:19
add comment

You've duplicated the virtualhost tag in the config, instead of opening and closing it. Also make sure that project.dev actually resolves to your host, e.g., ping project.dev

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.