In the Apache httpd and Tomcat to work together through mod_jk.so

1. Install Apache

See also: https://www.cnblogs.com/wcwnina/p/8044353.html

I finally downloaded the 2.4.41 version of the VC14: httpd-2.4.41-lre302-x86-vc14.zip

 

2. Install Tomcat

See my own blog: https://www.cnblogs.com/kxxx/p/5836704.html

3. Configure Apache

In the Apache installation directory (I use instead of% APACHE_HOME%)

3.1 First, download mod_jk.so, Download: https://tomcat.apache.org

 

 

 

 

 

 

 

 

 

 

 

 

Then find the version of the package i386-httpd-2.4.x.zip and download (Note: here to download the i386, x84_64 can not download, I will start downloading x84_64 subsequent error)

 

 

 

Unzip the downloaded After that, the files are copied to mod_jk.so% APACHE_HOME% of moudles folder

3.2 Configuration

3.2.1 httpd.conf (% APACHE_HOME% of the path in conf)

加入:Include conf/jk_module.conf

And before Include conf / extra / httpd-vhosts.conf # removed

3.2.2% APACHE_HOME% conf under accession jk_module.conf, and reads as follows:

LoadModule jk_module modules/mod_jk.so
JkworkersFile conf/workers.properties
JkLogFile logs/mod_jk.log

3.2.3% APACHE_HOME% conf under accession workers.properties, and reads as follows:

ps=\
worker.list=router
worker.router.type=ajp13
worker.router.host=127.0.0.1
worker.router.port=8009
worker.router.lbfactor=1

3.2.4% APACHE_HOME% under conf \ extra \ httpd-vhost.conf under the changes, as follows:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "D:\JAVA\apache-tomcat-8.0.14\webapps"
ServerName 192.168.1.111

JkMount /* router

ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

 

Finally, restart tomcat and Apache, configuration is complete.

Note: This configuration ServerName more important, only this will be forwarded to Tomcat to access ServerName

 

Guess you like

Origin www.cnblogs.com/kxxx/p/11913064.html