Integration of tomcat7 and apache2 under Linux

I used java as the background of the WeChat official account before, but the port cannot be 8080. So I thought of apache2 for port forwarding.
1. Tomcat enables port forwarding

vim /var/lib/tomcat7/conf/server.xml

Uncomment the following:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

2.apache2 installation module

apt install libapache2-mod-jk

3. Configure the home directory of tomcat and jdk

vim /etc/libapache2-mod-jk/workers.properties

According to your actual directory change as follows:

workers.tomcat_home=/var/lib/tomcat7
workers.java_home=/usr/lib/jvm/java-7-openjdk-amd64

4. Configure the items to be forwarded under the apache2 project directory

vim /etc/apache2/sites-enabled/000-default.conf

Add a sentence:

JkMount /WeChat/* ajp13_worker

Among them, WeChat is the path to be forwarded, and the corresponding project is deployed under /var/lib/tomcat7/webapps; ajp13_worker can be viewed in workers.properties.

Guess you like

Origin blog.csdn.net/CanvaChen/article/details/53149468