Today, the technical director called Apache and Tomacat integration. He found a lot of information on the Internet and found that it was the most convenient!
Below are two tomcat implementation load balancing, if there is only one, you can delete one
Apache2.2 and later versions, without using jk_mod to integrate tomcat, use ajp directly, very convenient.
Modify the apache configuration file httpd. conf
Enable mod_proxy_ajpCopy codeThe Code is as follows: # LoadModule proxy_module modules/mod_proxy.so
# LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
Remove the first two rows.
AddCopy codeThe Code is as follows: <VirtualHost *: 80>
ProxyPass/ajp: // 127.0.0.1: 8009/
ProxyPassReverse/ajp: // 127.0.0.1: 8009/
ServerName a.hackang.cn
</VirtualHost>
<VirtualHost *: 80>
ProxyPass/ajp: // 127.0.0.1: 9009/
ProxyPassReverse/ajp: // 127.0.0.1: 9009/
ServerName B .hackang.cn # The name here can be changed to localhost
</VirtualHost>
Done !!! This is what I use now.