centos 72 httpd tomcat-8环境配置

/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"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值