Apache can not distribute requests to Tomcat (that is, Apache reverse proxy unsuccessful) when using Apache to implement multi-tomcat load Balancing cluster with JK

Source: Internet
Author: User
Some days before doing Apache through JK to achieve a multi-tomcat load Balancing cluster, the reference network configuration after configuring the profile, access to the existing Tomcat file in the Apache hint URL does not exist, and then check the configuration file and Tomcat deployment, Found no problem with configuration deployment. Attempting to access the Apache static page, it is no problem to access Tomcat individually via HTTP. Then I guess will not refer to the configuration of the network before the problem, so continue to query the network other configuration found almost, try to change a variety of parameters are not resolved. Then I thought about it. The reason for this problem should be that Apache did not distribute HTTP requests to Tomcat (that is, the Apache reverse proxy was unsuccessful). That is, Apache does not implement the reverse proxy function at all. Finally, the problem is located on the configuration file, and it should be the Apache configuration file where there is a problem. But check and n times, tried various configuration changes are not resolved. Online search has not found a solution for a long time, and it seems that there are not many people encounter this problem. So this question has been bothering me for ten days. I was so digging a character, this did not solve the heart has been not comfortable. Finally God pays off, and today on the Internet to find some use Apache through JK implementation of multiple Tomcat load balancing configuration looked at. Finally see http://www.iteye.com/topic/1126930 such a post which has such a configuration: Remove Include conf/extra/ Httpd-vhosts.conf's comments inspired me, and this post mentions the addition of the configuration of the virtual host, because to increase the configuration of the virtual host, you need to remove Include conf/extra/ The httpd-vhosts.conf comment opens the Virtual host Configuration feature. Then I checked the include conf/extra/for my Apache httpd.conf configuration file. Httpd-vhosts.con this line, found no comment out, the default is to open the virtual host configuration, and I did not use or increase the configuration of the virtual host AH. So I try to comment out this line, that is, turn off the virtual host configuration function. The result is a miracle, and the problem is solved. Such a small configuration bothered me for ten days. Oh, I almost forgot. The Apache version I use is the latest version of 2.4. Not the previous release is not the default to turn this feature off, so you will not encounter this problem. Ah, no experience is really scary. A small default configuration change that bothers US novices. Again, thanks to the owner of this post, http://www.iteye.com/topic/1126930, if I hadn't been inspired to see this, I don't know.How long will it be bothering you? Also in this article as a souvenir, later encountered this problem can be resolved quickly. Hopefully my blog post will also help small partners who have similar problems.

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.