Use the IIS application request Forwarding (ARR) to achieve integration and sharing of port 80 between IIS and tomcat.

Source: Internet
Author: User

Use the IIS application request Forwarding (ARR) to achieve integration and sharing of port 80 between IIS and tomcat.

Currently, the methods for implementing iis and tomcat to share port 80 on the Internet are implemented based on the isapi_redirect plug-in. My implementation methods are different and the principles are similar, which has better advantages.

The disadvantage of isapi_redirect is that java projects exist as a virtual directory under iis, projects under iis use top-level domain names, and projects under tomcat can only be accessed as level-2 directories;

For example, if a project in iis is accessed using www.iisproject.com, the project in tomcat can only be accessed using www.iisproject.com/atatproject.UnfriendlyNow.

 

My implementation method uses the application request Routing (ARR) of IIS to forward requests.

"Sharing port 80"

General steps (for ARR usage, refer to the previous article or Baidu), install ARR on iis, and configure two server farm (iis applications use one iisFarm and tomcat uses one tomcatFarm ), each server farm has only one machine, namely localhost, and the Port uses its own application port (for example, iis application uses 8080 and tomcat application uses 8090). Each server farm sets a url to override the routing rules rule, the rules are forwarded to different serverFarm based on different URLs.

Scenario 1 access using different domain names

An application domain name under iis is www.iisproject.com, and an application domain name under tomcat is www.tomcatproject.com.

Routing rules used by iisfarm.

According to the settings, only the http request for port 80 under the www.iisproject.com domain name is sent to iisFarm in ARR for processing. iisFarm only has localhost: 8080, that is, the request is forwarded to the iis application with port 8080 for processing.

TomcatFarm routing rules settings

Similarly, the http request for port 80 under the www.atatproject.com domain name is sent to the tomcatFarm in ARR for processing. The tomcatFarm contains only servers with localhost: 8090, and tomcat works on port 8090, therefore, the request is processed by tomcat.

Scenario 2 use level-2 Directory Access

Scenario 1 uses two different domain names. If there is only one domain name or no domain name, we can also use the domain name/second-level directory or IP/second-level directory for access, for example, www.project.com/iis,www.project.com/tomcat or 192.168.0.10/iisproject, 192.168.0.10/atatproject. the implementation method is almost the same as scenario 1. When you configure routing rules, iisfarmis directed to the url for www.project.com/iis, and tomcat farmfor the header of www.project.com/tomcatm. you can use regular expressions and wildcards to handle this.

In the above two scenarios, whether using domain name access or using level-2 Directory Access,In the view of external clients, iis and tomcat applications share port 80..

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.