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

I have a Java application server (GlassFish, indeed, but the problem is the same for any other application server, I guess), running on port 8080. And I have IIS 7.5 listening on port 80 as by default configuration.

I want to avoid people typing the port because it's unprofessional. So I want that when somebody types

http://myserver

the traffic is directed to IIS. And this is how it already works now. But I also want that when somebody types

http://myserver/java

the traffic is directed to port 8080 and consequently my GlassFish splash screen is displayed. If I have deployed an application on GlassFish under context root app1, typing

http://myserver/java/app1 

should access the application.

How can I do this? I have tried with adding some rules with the URL Rewrite utility from IIS7.5 UI, but this shows the port after the rule has rewritten the url, and I want to avoid it.

share|improve this question

2 Answers 2

You have several choices, but I recommend

http://tomcatiis.riaforge.org/

Microsoft's ARR is another approach but is heavier-weighted,

http://blogs.iis.net/mailant/archive/2009/10/22/how-you-can-use-iis7-as-web-front-to-java-app-servers-in-a-3-tier-architecture.aspx

share|improve this answer

It might be easier if you can use a sub-domain for the java app like http://java.myserver/. Then you could do something like the following, though I'm not familiar with GlassFish but I assume you can configure it to listen on a certain IP address like with TomCat. If you want to use port 80 for both apps you need IIS to listen on IP Address A and GlassFish to listen on IP Address B. Then use DNS to point myserver to IP A and java.myserver to IP B.

Then follow these steps: http://www.fredmastro.com/post/Restrict-IIS-to-listen-only-on-X-IP-Address-Allowing-you-to-co-run-with-TomCatApache-on-port-80-with-IIS-on-port-80.aspx

Basically limit IIS to only listen on IP A and not bind IP B. So that GlassFish can bind it to port 80.

Open a command prompt as an administrator

Show which IP Address IIS is listening/binding too with this command.

netsh http show iplisten

Then limit IIS to listen/bind certain IP address with this command

netsh http add iplisten xxx.xxx.x.x

Reboot the server (You could try restarting http service but that doesn’t always show up in services and it’s a pain. Easier to reboot).

share|improve this answer

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.