/opt/httpd-2.4.38 --httpd软件目录
/opt/apache-tomcat-8.5.38 --tomcat软件目录
/opt/java/jdk1.8.0_201-amd64 --jdk目录
编译 httpd2.4.38参数
yum -y -q install apr-devel apr-util-devel openssl-devel pcre-devel mod_ssl expat-devel
./configure --prefix=/opt/httpd-2.4.38 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --enable-modules=most --enable-mpms-shared=all --with-mpm=worker
httpd-devel
删除旧版java
rpm -qa | grep java
rpm -e nodeps xxxxx
修改java环境变量
export JAVA_HOME=/opt/java/jdk1.8.0_201-amd64/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar?
export PATH=$PATH:$JAVA_HOME/bin
httpd-devel
编译mod_jk.so参数
./configure --with-apxs=/opt/httpd-2.4.38/bin/apxs
httpd.conf修改内容
/var/webapps为网站目录
DocumentRoot "/var/webapps"
<Directory "/var/webapps">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
LoadModule jk_module /opt/httpd-2.4.38/modules/mod_jk.so
Include /opt/httpd-2.4.38/conf/mod_jk.conf
mod_jk.conf配置内容
JkWorkersFile /opt/httpd-2.4.38/conf/workers.properties
# Where to put jk logs
JkLogFile /etc/httpd/logs/mod_jk.log
# Set the jk log level[debug/error/info]
JkLogLevel info
# Select the log format
#JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate tosend SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat setthe request format
JkRequestLogFormat "%w %V %T"
# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
JkMount /*.jsp worker1
JkMount /a/*.jsp worker1
workers.properties内容
# Defining a workernamed worker1 and of type ajp13
worker.list=worker1
# Set properties forworker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
server.xml配置修改内容
<Host name="localhost" appBase="/var/webapps"