2

I want to expose a Java application via IIS. I found an answer in Running a java web application in IIS that refers to the isapi redirector. However what also seems to work for me is to set up IIS URL rewriting rules. E.g. I have set up a rewrite rule that matches ^java/(.*) and rewrites it to http://localhost:8080/{R:1}

I am a programmer and not a web server administrator, so I do not understand the implications of one versus the other. Which is the preferred approach and why? URL rewriting seems simpler to setup since it involves less 'moving parts' and less configuration.

Community
  • 1
  • 1
Jeroen Huinink
  • 1,947
  • 3
  • 17
  • 31

1 Answers1

0

In my experience I've had to use the ISAPI redirector when the following conditions are met:

  1. Company/System policy doesn't allow to expose another HTTP port on the server (i.e. 8080/tcp), and IIS already owns 80/tcp, so another server can not be bound to this or any HTTP port. In this case IIS and the Java server communicate through the AJP port, and the workers files have to be configured to redirect only to the context of the Java application.
  2. [Optional] For performance reasons, static content (html, js, css, jpg, ...) has to be hosted on IIS and only the dynamic content is left for the Java server. Again this calls for some careful workers configuration and selective deployment of content on each servers.

If you don't have to meet any of these conditions, and if Company/System policy doesn't enforce that all requests go through IIS, then a URL rewriting rule is probably OK.

betomontejo
  • 1,657
  • 14
  • 26
  • When I configure the rewrite rules in IIS, it acts as a proxy and there is no need to expose the 'java' port externally. All traffic goes through port 80. Thanks for the suggestion in 2. That makes sense, but the fact that the rewrite rules don't make it necesssray to expose the other port was my reason for asking. – Jeroen Huinink Jul 25 '12 at 06:06