Apache2.2 and later versions are integrated with Tomcat configuration and load balancing implementation

Source: Internet
Author: User

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.

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.