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.

I am brand new to web development...and getting WAMPServer running is a barrier no amount of Googling has helped solve.

When I install WAMPServer it works fine. When I try to add local domain names, it goes wrong. Can anyone tell me why?

Things I have tried.

In

C:/Windows/System32/drivers/etc/hosts

I added

'127.0.0.1 my.testsite'

Then, in

C:/wamp/bin/apache/Apache2.2.22/conf/httpd.conf

I have removed the # from

'# Include conf/extra/httpd-vhosts.conf'

Then, in C:/wamp/bin/apache/Apache2.2.22/conf/extra/httpd-vhosts.conf I added

< Directory C:/WAMPprojects>
Order Deny,Allow
Allow from all
< /Directory>

and

< VirtualHost *:80>
DocumentRoot “C:/WAMPprojects/Hermes”
ServerName my.testsite
< /VirtualHost>

When I enter my.testsite into the address bar, I expect to see the content of the index.html page that’s in the Hermes folder.

After a fresh install of WAMP where the taskbar icon turns green, I Have made these changes and every time I restart WAMP Server it stops at orange.

Therefore I have also tried:

  • Turning off Skype
  • Changing Skype settings so it does not listen at port 80 (Tools>Options>Advanced>Connection>Use port 80 and 443 as alternatives for incoming connections. Untick.)
  • Checking nothing else is listening at port 80
  • Changing the port to 8080
  • Changing the port to a different number
  • Adding ::1 to hosts

I cannot determine what’s going on in the Apache error log.

I am on Windows XP (SP3) and Apache 2.2.22 Is it a case of incompatibility or can it be fixed?

Thank you very much in advance if anyone can give me a clue on this - I've been stuck for months now.

share|improve this question
    
The real key here is that when you restart WAMP after modifying your conf files, your status icon isn't going green - this is most likely due to an issue with your configuration files (meaning you wouldn't have needed to futz around with skype, ports, etc) - debug efforts should focus on the conf files. I'm not sure where the errors with conf files get logged in WAMP, but I'd take the time to figure that out now if I were you . . . –  ernie May 29 '13 at 21:59
    
Thanks, Ernie. I'll keep the .conf files in mind, then. –  user2434029 May 29 '13 at 22:34
add comment

2 Answers 2

Expanding on my comment:

The real key here is that when you restart Apache after modifying your conf files, your status icon isn't going green - this is most likely due to an issue with your configuration files (meaning you wouldn't have needed to futz around with Skype, ports, etc) - debug efforts should focus on the Apache conf files. I'm not sure where the errors with conf files get logged in WAMP, but I'd take the time to figure that out now if I were you . . .

I think the issue is that <directory> sections can't be top level in included conf files. As stated in the documentation, their context is server config or virtual host, meaning it needs to either be in the main conf file (i.e. httpd.conf) or in a <VirtualHost> definition. Try something like this:

< VirtualHost *:80>
    DocumentRoot “C:/WAMPprojects/Hermes”
    ServerName my.testsite
    <Directory C:/WAMPprojects>
        Order Deny,Allow
        Allow from all
    </Directory>
< /VirtualHost>
share|improve this answer
    
No luck unfortunately :/ It bugs me that this could be so simple, but maybe I'll give in and try XAMPP or AMPPS instead. –  user2434029 May 30 '13 at 8:12
    
what's in your apache error.log? –  ernie May 30 '13 at 18:02
    
Also, switching to one of the other stack distributions probably won't help - you're running into issues with Apache, which is a common thread between all of these . . . –  ernie May 30 '13 at 19:55
add comment

Here's some detail on what happens when your brower makes a request to a server that should fill in the details:

  • You type http://whatever.invalid in the address bar
  • Browser uses system resolver to issue a DNS request to convert whatever.invalid to an IP address
  • Browser makes HTTP GET request to the IP returned by that DNS request.
  • Within the header of that HTTP GET request, your browser places a "Host:" line, copying the domain name you used, i.e. "Host: whatever.invalid"
  • Apache gets the request, IF the IP was correct.
  • Apache checks the HTTP header for any "Host:" lines and uses the proper vhost, if such a configuration exists.

So, the piece of the puzzle you are missing is a DNS server willing to take your site name and return the IP on which your Apache server lives, which is currently localhost.

You could run your own local DNS server, or just dispense with vhosts and use http://localhost or http://127.0.0.1 in your browser.

Just reread your question more closely and saw that you used the hosts file. Try pinging my.testsite and see if 127.0.0.1 is returned by ping. You may need to remove any existing localhost references in the hosts file. (Incidentally, I just tried a ping -4 localhost on the Windows system I'm on and it did cause a ping to 127.0.0.1 ... so it may be something else ...)

share|improve this answer
    
Since they modified their hosts file, the DNS lookup should happen locally. Of course, if the OP wants to verify that their hosts file is correct, they could just drop to the command prompt, and try pinging my.testsite, and see if it resolves. –  ernie May 29 '13 at 21:55
    
Right, I just caught that. –  ultrasawblade May 29 '13 at 21:57
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.