Experimental environment
1. Install and start Apache1.1 Installation yum -y install httpd 1.2 Startup systemctl start httpd 2. Install and start tomcat2.1 Install JDK rpm -ivh jdk-8u131-linux-x64_.rpm 2.2 Verify that JDK is installed successfully [root@host-136 ~]# java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) 2.3 Unzip the Tomcat installation package and move it to the /opt directory 2.3.1 Decompression tar xzf apache-tomcat-8.5.35.tar.gz 2.3.2 Mobile name change mv apache-tomcat-8.5.35 /opt/tomcat 2.4 Start the service /opt/tomcat/bin/startup.sh 3. Install the connector tomcat-connectors source code3.1 Installation Required Environment yum -y install httpd-devel gcc gcc-c++ 3.2 Decompression tar zxf tomcat-connectors-1.2.48-src.tar.gz 3.3 Detect environment and configure cd tomcat-connectors-1.2.48-src/native ./configure --with-apxs=/usr/bin/apxs 3.3 Compile and install make && make install 3.4 Verify installation is successful [root@host-136 native]# ll /etc/httpd/modules/mod_jk.so -rwxr-xr-x. 1 root root 1565864 Jan 6 09:32 /etc/httpd/modules/mod_jk.so 4. Create a test page4.1 Static Pages vim /var/www/html/index.html <h1>static_page_from_apache</h1> 4.2 Dynamic Pages vim /opt/tomcat/webapps/ROOT/test.jsp <h1>dynamic_page_from_tomcat</h1> 5. Configure the jk module to integrate Apache with tomcat5.1 Copy the configuration file cd tomcat-connectors-1.2.48-src/conf/ cp httpd-jk.conf /etc/httpd/conf.d/ cp workers.properties /etc/httpd/conf/ 5.2 Modify the workers.properties configuration file vim /etc/httpd/conf/workers.properties 5.2.1 Change port to 8009 Note: The Connector AJP Port is used to listen for requests on the AJP (Apache JServ Protocol) protocol. It is usually used to integrate other HTTP servers such as Apache Server. The default value is 8009. 5.2.2 Comment or delete the lines 86 87 88 89 96 5.3 Modify the httpd-jk.conf configuration file vim /etc/httpd/conf.d/httpd-jk.conf Remove the comments from line 94 and modify it as follows 6. Restart Apache servicesystemctl restart httpd 7. Access page test7.1 Enter ip/index.html in the browser to test the static page 7.2 Enter ip/test.jsp in the browser to test the dynamic page This is the end of this article about combining Apache with Tomcat to achieve dynamic and static separation. For more relevant content about combining Apache with Tomcat to achieve dynamic and static separation, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Some tips on deep optimization to improve website access speed
>>: Reflection and Proxy in Front-end JavaScript
question CSS fixed positioning position:fixed is ...
In many cases, you need to process the background...
Table of contents 1. Process 2. Core Architecture...
I've been writing a WeChat applet recently an...
Preface: I encountered a requirement to extract s...
When is the table used? Nowadays, tables are gene...
This article shares the specific code for the WeC...
MySQL 8.0.3 is about to be released. Let’s take a...
title: vue uses vue-meta-info to set the title an...
This article example shares the specific code of ...
Table of contents Background Description Creating...
<br />Original source: http://www.a-xuan.cn/...
This article example shares the specific code of ...
npm installation tutorial: 1. Download the Node.j...
In cells, dark border colors can be defined indiv...