Use apache's proxy-ajp to do the combination of Apache and Tomcat

xiaoxiao2021-04-07  367

Today, I found Apache-2.2.0 on the Internet to add a proxy-ajp module, and looked at it, it could be combined with the Tomcat and Apache. So I tried it and tried it is very convenient than the original method. Let me illustrate my installation steps. Tomcat and JDK installation online too many tutorials I will not introduce here. You can see other tutorials.

First download the source code of Apache-2.2.0 from http://www.apache.org's website. Apache-2.2.0 version has made some changes to you need to pay attention. First, APR and APR-Util require a separate installation, and the configuration file is made by the original one, but it is clear that it is clear that that part is configured in that configuration file. The installation steps are as follows:

Unzip Apache source code # tar xvjf httpd-2.2.0.tar.bz2 # cd httpd-2.2.0

Installing APR # cd srclib / Apr # ./configure --prefix = / server / Soft / Apr # make # make install

Install APR-UTIL # CD ../apr-util/# ./configure --prefix = / server / Soft / APR-UTIL / --WITH-APR = / Server / Soft / Apr # make # make install # cd. ./../

Install apache # ./configure --prefix = / server / Soft / Apache / --Nable-so / --enable-release = share / --enable-proxy = share / --enable-proxy-ajp = share / -ENABLE-DAV = Share / --With-Apr = / Server / Soft / APR / --WITH-APR-UTIL = / Server / Soft / Apr-Util / # make # make install

# / server / soft / apache / bin / httpd -l // See if there is Proxy-Ajp This module If this module has proved that the Proxy-Ajp module is successful, it can be combined with Tomcat.

# vi /server/soft/apache/conf/httpd.conf Remove "#" in front of "#include conf / extra / httpd-vhosts.conf" to edit / Server / Soft / Apache / conf / extra / httpd-vhosts .conf

Edit the following code ServerAdmin admin@easyea.com ProxyPass / ajp: // localhost: 8009 / ProxyPassReverse / ajp: // localhost: 8009 / ServerName localhost ServerAlias ​​www.easyea.com ErrorLog logs / easyea. COM-Error_Log Customlog logs / easyea.com-access_log common

Then start Tomcat first, then start apache # / server / soft / apache / bin / apachctl start Open the browser to see if the Tomcat welcomes page, if it is the success of Apache and Tomcat

转载请注明原文地址:https://www.9cbs.com/read-132633.html

New Post(0)