0

I have Tomcat and IIS 7 installed together on a Windows 2008 server. The machine has two IPs (134.133.1.1 and 134.133.2.2).

I want Tomcat to handle 134.133.1.1, on port 80, and IIS to handle both 134.133.2.2, on port 80 AND 134.133.1.1, on port 443, but can't seem to get the last two together (I can get one or the other by themselves on IIS, along with the first IP address on Tomcat).

I have configured Tomcat to successfully listen to ip 134.133.1.1, on port 80 with this configuration;

<Connector port="80" 
    protocol="HTTP/1.1"
    address="134.133.1.1"
    connectionTimeout="20000"
    redirectPort="8443" />

I also have a site configured in IIS bound to ip 134.133.1.1, on port 443 (SSL). When I turn on IIS, after Tomcat, I can reach both 134.133.1.1:80 (Tomcat) and 134.133.1.1:443 (IIS) successfully (as desired).

The problem now comes when I want to introduce a new site via IIS, at the new ip address. In IIS I have setup a new site at IP 134.133.2.2, port 80. I can not start the site. The event log shows this error;

Unable to bind to the underlying transport for [::]:80. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number.

I think this is because IIS 7 tries to listen to port 80 on all IPs, and it cant because Tomcat is taking port 80 for 134.133.1.1. From reading, the resolution is to specify the IP address you want IIS to bind on port 80. The problem is, when I add 134.133.2.2 to the iplisten list, then I get a 404 when I try navigating to 134.133.1.1:443. I assume this is because IIS is no longer listening to ANY port on 134.133.1.1.

How do I resolve this such that IIS will return both sites?

EDIT: Per request my IIS binding for site A is 134.133.2.2 on port 80 (http) and 134.133.2.2 on port 443. For site B in IIS, the binding is 134.133.1.1 on port 443 (https). Note the IPs in this example are just for example purposes, but consistent with my setup.

3
  • 1
    Can you add the exact bindings you have for both websites as they appear in the IIS configuration?
    – gtirloni
    Aug 15, 2014 at 21:59
  • @gtirloni see update
    – n00b
    Aug 18, 2014 at 14:31
  • What says netstat -an ?
    – krisFR
    Aug 21, 2014 at 20:00

2 Answers 2

1

I had the same issue on Windows Server 2008, attempting to run Tomcat and IIS on port 80 on two separate network interfaces. In order to force IIS to listen on port 80 only on a specific network interface you must follow the instructions below. It is not enough merely to change the site bindings in IIS.

From Microsoft KB article 954874:

When you install Internet Information Services (IIS) 7.0 in Windows Server 2008, IIS binds to all IP addresses on the server, not merely the IP addresses that are assigned to Web sites. This behavior may occur even though you have set the DisableSocketPooling metabase property in the IIS configuration settings to True.

To resolve this issue, use the Netsh command prompt utility to configure the IP listen list in Windows Server 2008.

netsh http add iplisten xxx.xxx.x.x

Source: http://support.microsoft.com/kb/954874

3
  • I mentioned using this in my question. The problem is it will then only listen for those ip's and none other.
    – n00b
    Mar 3, 2015 at 15:03
  • That doesn't seem to be a combination that will work given how IIS and http.sys work. Your best bet might be to bind Tomcat to something other than port 80 and use the URL Rewrite module in IIS to rewrite (not redirect) incoming requests, forwarding them to that port. Please note that I haven't tested this potential solution but it might be a starting point. Mar 4, 2015 at 15:43
  • yea, in the end we ended up using some 3rd party tool, that essentially did what url rewrite did. next time id just use url rewrite, thanks.
    – n00b
    Mar 4, 2015 at 20:54
0

Don't use iplisten to assign IP addresses to IIS.

Just use the bindings for each site. iplisten binds the IP address to the HTTP.sys service, and really ties your hands. You're looking to only let HTTP.sys listen for traffic on port 443 on IP 134.133.1.1 and for traffic on ports 80 and 443 on IP 134.133.2.2. Just add the IPs and ports to the bindings and see if that alleviates your problem.

Alternatively, run netstat -aon and see what's listening on TCP port 80. You'll get a PID list, and you can match that up with to a process name in Task Manager. For example, if I run 'netstat -aon`, I get something similar to this:

Proto  Local Address          Foreign Address        State           PID
TCP    172.18.5.23:443        0.0.0.0:0              LISTENING       1268
TCP    172.18.5.23:80         0.0.0.0:0              LISTENING       1268
TCP    172.18.5.24:80         135.25.167.62:443      ESTABLISHED     9652
TCP    172.18.5.24:18462      10.200.40.1:443        ESTABLISHED     7312
TCP    172.18.5.23:18463      10.200.40.1:443        ESTABLISHED     7312

Now if I open Task Manager and look at the PID line, I can compare and see that Tomcat7.exe has a PID of 9652, so it's listening on TCP port 80. Compare the two results. You may discover that another process is stealing port 80 on that IP address from you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .