Pre-conditions
Rpm-qa httpd
Yum-y Install Pcre-devel
1. Compile and install Apr
Tar XF apr-1.5.2.tar.gz
CD apr-1.5.2
./configure--PREFIX=/USR/LOCAL/APR
Make && make install
2. Compile and install Apr-util
Tar XF apr-util-1.5.4.tar.gz
CD apr-util-1.5.4
#--with-apr=path
#--prefix=prefix
./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/
Make && make install
3. Compile and install Apache
Tar XF httpd-2.4.18.tar.gz
CD httpd-2.4.18
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd--enable-so \
--enable-ssl--enable-cgi--enable-rewrite--with-zlib--enable-mpms-shared=all \
--with-mpm=event--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util \
--enable-proxy--enable-proxy-http--ENABLE-PROXY-AJP--enable-proxy-balancer \
--enable-lbmethod-heartbeat--enable-slotmem-shm--enable-slotmem-plain \
--enable-heartbeat--enable-heartmonitor--enable-watchdog
Make && make install
Configure Apache to combine with Tomcat via the Mod_proxy module
To use Mod_proxy with Tomcat, Apache has installed Mod_proxy, mod_proxy_http, MOD_PROXY_AJP, and Proxy_balancer_module
Modules (used when implementing a Tomcat cluster)
Try to start Apache
/usr/local/apache/bin/httpd-k start
Netstat-tunlp
Found not 80 ports up, try several times or start not to
View HTTPD Logs
Cat/usr/local/apache/logs/error_log found the following error:
[Tue 17 07:10:46.572233 2016] [Proxy_balancer:emerg] [PID 1434:tid 139691988010752] Ah01177:failed to lookup provider ' SHM ' for ' slotmem ': Is Mod_slotmem_shm loaded??
[Tue 17 07:10:46.572778 2016] [: Emerg] [PID 1434:tid 139691988010752] Ah00020:configuration Failed, exiting
[Tue 17 07:16:15.916227 2016] [Proxy_balancer:emerg] [PID 1438:tid 139879976126208] Ah01177:failed to lookup provider ' SHM ' for ' slotmem ': Is Mod_slotmem_shm loaded??
[Tue 17 07:16:15.916951 2016] [: Emerg] [PID 1438:tid 139879976126208] Ah00020:configuration Failed, exiting
The module MOD_SLOTMEM_SHM is not loaded according to the error message and the configuration file is modified
Vim/etc/httpd/httpd.conf
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so To remove the comment #
/usr/local/apache/bin/httpd-k start
Netstat-tunlp
So the service finally started up.
Tomcat-based Tomcat combined with Apache module proxy proxy Apache installation