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
Six steps of JDBC: 1. Register the driver 2. Get ...
Designers have their own font library, which allo...
Implement Nginx load balancing based on Docker ne...
There are some issues that are not limited to Vue...
Introduction When writing SQL today, I encountere...
Sometimes you need to use links, but you don't...
<br />In order to clearly distinguish the ta...
When we write some UI components, if we don't...
Table of contents Preface React Functional Compon...
Table of contents 1. In project development, the ...
vmware workstations starts the virtual machine er...
Let's take a look at zabbix monitoring sqlser...
First download the dependencies yarn add sass-loa...
There is a difference between src and href, and t...
Given a div with the following background image: ...