Use Apache to convert tomcat to access through the second-level domain name of port 80, apachetomcat
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 weixin.erdian.net 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.
In linux, apache and tomcat are installed. In apache, port 80 is used, and in tomcat, port 8080 is used.
Domain Name access has nothing to do with apache tomcat priority
If tomcat is changed to port 80, apache cannot use port 80 again. If apache is started, an error is returned.
The domain name is resolved to the configured ip address, and ie accesses port 80 of your ip address, so that tomcat or apache is configured on port 80.
How can I change the port 8080 of apache-tomcat to port 80?
There is a server. xml file in the conf folder of Tomcat. Modify the <Connector
Port = "80" maxHttpHeaderSize = "8192"
MaxThreads = "150" minSpareThreads = "25" maxSpareThreads = "75"
EnableLookups = "false" redirectPort = "8443" acceptCount = "100"
ConnectionTimeout = "20000" disableUploadTimeout = "true"/> in this Code, the port value is the port number!