/*** CentOS-6.4-minimal integrates APACHE-2.2.29 with Tomcat-6.0.41 * versions * AJP (APACHE jserver protocol) through a JK-1.2.40) * Tomcat provides special JK plug-ins to communicate with Tomcat and HTTP servers (such as Apache, nginx, and IIS, that is, we often see that after mod_jk * JK is installed on the HTTP server of the other party, when the HTTP server receives a customer request, it filters the URL through JK, JK determines whether to forward the request to Tomcat based on the pre-configured URL ing information. * JK implements communication between APACHE and tomcat through the AJP protocol, the AJP protocol is a customized protocol for communication between Tomcat and HTTP servers. It can provide high communication speed and efficiency. * ajp12 has been deprecated and is currently using version 1.3, the ajpv13 protocol is a packet-oriented * Web server and servlet container that interact over TCP connections. To save the expensive cost of socket creation, the web server will try to maintain a permanent TCP connection to the servlet container * and reuse this connection in the Process of multiple requests and response cycles. Once a connection is assigned to a specific request, therefore, the connection cannot be reused before the request processing period ends. * In general, this is because of the following two reasons, the efficiency of communication using the AJP protocol is higher than that of the HTTP protocol * 1) The AJP adopts a persistent connection, which ensures the communication between Tomcat and the HTTP server and reduces the overhead of establishing a TCP connection * 2) AJP uses a certain protocol format, reduces the size of the data transmitted packets, saving the bandwidth * ---------------------------------------------------------------------------------------------------------------------- * install JK-1.2.40 * 1) to specify the location of apxs in the Apache installation directory during installation, it allows us to dynamically load modules. After installation, a mod_jk.so file is generated under the modules directory of apapche * 2) If Autoconf or libtool not found is prompted during installation, then Yum-y install Autoconf or libtool * [[email protected] software] # tar zxvf tomcat-connectors-1.2.40-src.tar.gz * [[email protected] software] # cd tomcat-connectors-1.2.40-src/native/* [[email protected] Native] #. /buildconf. sh * [[email protected] Native] #. /configure -- With-apxs =/APP/Apache/bin/apxs * [[email protected] Native] # Make * [[email protected] Native] # make install * [[email protected] Native] # ll/APP/Apache/modules/* ---------------------------------------------------------------------------------------------------------------------- * install Tomcat-6.0.41 * Without compiling the source code, directly extract the [tar zxvf apache-tomcat-6.0.41.tar.gz], and then execute/APP/tomcat/bin/startup. sh can start Tomcat * ---------------------------------------------------------------------------------------------------------------------- * configure Tomcat * 1) Disable HTTP protocol * Comment server. <connector Port = "8080" protocol = "HTTP/1.1" connectiontimeout = "20000" redirectport = "8443"/> * 2) Enable the AJP Protocol * to keep the server. <connector Port = "8009" protocol = "AJP/1.3" redirectport = "8443"/> * ---------------------------------------------------------------------------------------------------------------------- * configure Apache * 0) for installation of Apache, see http://blog.csdn.net/jadyer/article/details/39583879 * 1) modify/APP/Apache/CONF/httpd. CONF file * enable VM --> uncomment include CONF/extra/httpd-vhosts.conf * Add JK configuration ---> Add a line include CONF/extra/httpd-jk.conf * 2) create the/APP/Apache/CONF/extra/httpd-jk.conf file and add the following content * loadmodule jk_module modules/mod_jk.so * jkworkersfile CONF/workers. properties * jklogfile logs/mod_jk.log * jkloglevel info * 3) Create/APP/Apache/CONF/workers. properties file, and add the following content * worker. list = Tomcat * worker. tomcat. type = ajp13 * worker. tomcat. host = 192.168.0.103 * worker. tomcat. port = 8009*4) modify the/APP/Apache/CONF/extra/httpd-vhosts.conf file and add the following content (you can use the # To comment out the original two <virtualhost *: 80/> default configuration) * <virtualhost *: 80> * servername "www.jadyer.com" * DocumentRoot "/APP/tomcat/webapps/Docs" * errorlog "logs/www.jadyer.com-error. log "* customlog" logs/www.jadyer.com-access. log "common * <directory"/APP/tomcat/webapps/Docs "> * options followsymlinks * AllowOverride none * order allow, deny * allow from all * </directory> * jkmount/* Tomcat * jkunmount /*. HTML Tomcat * jkunmount /*. JPG Tomcat * jkunmount /*. CSS Tomcat * jkunmount/CSS/* Tomcat * jkunmount/JS/* Tomcat * jkunmount/lib/* Tomcat * </virtualhost> * optional * @ create Sep 27,201 4 1:39:24 *@ author Xuan Yu
Integrating APACHE-2.2.29 with Tomcat-6.0.41 with CentOS-6.4-minimal