About the integration of apache and tomcat
我想大声告诉你
我想大声告诉你 2017-05-16 16:59:06
0
1
525

The company website is written in jsp
The company's official account is written in php
One uses apache and the other uses tomcat
How to share the two ports to port 80?
Or jsp requests are distributed to tomcat for processing
Most of the ones on the Internet use the mod_jk module. This module has not supported the new version of apache a long time ago.
Is there any use of the proxy module? If so, please give details. Described method
Environment
centOS6.5
apache2.2
tomcat7
jdk1.7

我想大声告诉你
我想大声告诉你

reply all(1)
伊谢尔伦

nginx as a reverse proxy can help you.
php is forwarded to apache, and java is forwarded to tomcat.


apache IP 192.168.1.101
tomcat IP 192.168.1.102

nginx configuration

server {
listen      80;
server_name www.a.com;
index index.html index.php index.jsp;
root        /home/www/www.a.com;
access_log  /var/log/nginx/a_access.log main;

location ~ \.php$ {
        proxy_pass 192.168.1.101;
 }

location ~ \.jsp$ {
        proxy_pass 192.168.1.102;
 }
}

The dividing line is not displayed on the computer, but it is displayed on the mobile phone. I struggled for a whole afternoon...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template