1. Compile and install Apache
Download: official website http://httpd.apache.org/docs/2.4/install.html
wget http://ftp.twaren.net/Unix/Web/apache//Httpd/httpd-2.4.29.tar.gz
wget http://ftp.mirror.tw/pub/apache//apr/apr-1.6.3.tar.gz
wget http://ftp.mirror.tw/pub/apache//apr/apr-util-1.6.1.tar.gz
TAR-ZXF httpd-2.4.29.tar.gz
Tar zxf apr-1.6.3.tar.gz
Tar zxf apr-util-1.6.1.tar.gz
MV Apr-1.6.3.tar.gz Apr-util
MV Apr-util httpd-2.4.29/srclib/
MV apr-util-1.6.1 Apr-util
MV Apr-util httpd-2.4.29/srclib/
CD httpd-2.4.29/srclib/
./configure--prefix=/usr/local/apache2--enable-modules=most--enable-mods-shared=all--enable-so-- With-included-apr
--enable-modules=most # means to statically compile most modules into a httpd binary file
--enable-mods-shared=all # indicates that all modules are loaded dynamically, and if-shared is removed, all modules are loaded statically
Make && make install
If make install appears #include <expat.h> missing
Yum Install Expat-devel-y
2. Install Tomcat
wget http://ftp.mirror.tw/pub/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24.tar.gz
Tar zxf apache-tomcat-8.5.24.tar.gz
MV apache-tomcat-8.5.24 tomcat8.5.24
3. Installing the JDK
wget http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
TAR-ZXF jdk-8u151-linux-x64.tar.gz
Jdk1.8.0_151/bin/java-version
4. Installing JK Module
wget http://apache.stu.edu.tw/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.42-src.tar.gz
Yum Install Libtool autoconf-y
Tar zxf tomcat-connectors-1.2.42-src.tar.gz
CD tomcat-connectors-1.2.42-src/native/
./buildconf.sh
./configure--with-apxs=/usr/local/apache2/bin/apxs
Make && make install
You can see that there are mod_jk.so file generation, which is the JK connector we need. is automatically loaded into the/usr/local/apache2/modules directory by default
Apache Tomcat Integration