Use Apache to convert tomcat to access through the second-level domain name of port 80

Source: Internet
Author: User

Use Apache to convert tomcat to access through the second-level domain name of port 80

Generally, you can use tomcat to publish a Java web project and use www.xxx.com: 8080/appname/xxxservlet to access a simple service. In this way, the application name will be 'exposed '(you can also change it ), it seems that it is not standard, and you need to enter the port (of course you can also directly publish it to port 80, but if multiple systems such as one PHP have to be considered ).

Apache uses port 80 to forward different requests to different applications of tomcat, that is, all services come from port 80.

Open httpd. conf and add it at the end (preferably before wildcard parsing)

<VirtualHost *: 80> ServerName implements ProxyPreserveHost On ProxyRequests Off ProxyPass/http: // 115.28.189.59: 8080/Weixin/ProxyPassReverse/http: // 115.28.189.59: 8080/Weixin/ErrorLog logs/weixin.erdian.net _ error_log CustomLog logs/weixin.erdian.net _ custom_log common </VirtualHost>
In this way, a web application that needs to be accessed through http: // 115.28.189.59: 8080/Weixin/is converted to a second-level domain name for access.

The backend address of the public platform must use port 80 for forwarding.

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.