Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have read countless articles on setting up a domain on WAMP to listen on a port other than 80; none of them are working.

I've got Windows Server 2008 (Standard) with IIS 7 installed and running on port 80 (and 443).

I've got WAMP installed with the following configuration.

Listen 81
ServerName sub.example.com:81
DocumentRoot "C:/Path/To/www"
<Directory "C:/Path/To/www">

    Options All MultiViews

    AllowOverride All

#   onlineoffline tag - don't remove
    Order Allow,Deny
    Allow from all

</Directory>

localhost:81 works with the above configuration but sub.example.com:81 does not.

Just to make sure my firewall wasn't getting in the way I have disabled it completely.

My sub.example.com domain is already pointing to my server and works on IIS on port 80.

Also, if I disable IIS and change the Apache port from 81 to 80 it works.

Yes, I am restarting Apache after each httpd.conf change. :-)

I don't need any other domain (or sub domains [I don't even care about localhost]) configured which is why I'm not using a VirtualHost.

Any ideas what is going on here? What could I be doing wrong?


Update

Changing Listen to 80 but keeping ServerName as sub.example.com:81 causes navigation to sub.example.com:80 to work; this just doesn't seem right to me. Could ServerName be ignoring the :port part somehow?


netstat -a -n | find "TCP":

>netstat -a -n | find "TCP"
  TCP    0.0.0.0:81             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING
  ...
  TCP    127.0.0.1:81           127.0.0.1:49709        TIME_WAIT
  ...
share|improve this question
    
-- comment removed since the question the comment answered was removed -- –  David Murdoch Jun 27 '11 at 20:15
    
Post the output of netstat -a -n | find "TCP", or at least the entry for Apache. Specifically has Apache bound to 0.0.0.0, 127.0.0.1, or one of the IP addresses assigned to your host? –  Zoredache Jun 27 '11 at 20:17
    
I've updated the question to provide the full netstat -a -n | find "TCP" command you requested. –  David Murdoch Jun 27 '11 at 20:24
    
Updated with more info –  David Murdoch Jun 27 '11 at 20:37
    
Strange, the port on the ServerName is optional I think, try without it. –  faker Jun 27 '11 at 20:50

2 Answers 2

had to set up the same thing recently. There is a registry hack you have to perform to get it to work. Check out this website article for more info. Specifically the section on editing the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList.

http://beyondweblogs.com/setting-both-wamp-iis-on-80-port-no-need-of-81-now/

share|improve this answer
up vote 0 down vote accepted

#facepalm

The router was configured to allow ports 80 and 443 only. That is why port 81 worked with localhost but not the domain.

I just needed to forward ports 80 AND 81 to the web-server and it worked.

share|improve this answer
1  
Remember to come back and click the check mark. –  Michael Hampton Oct 31 '12 at 0:58

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.