Centos 8 安装 Openbravo 之安装 httpd mod_jk

普通方式安装 httpd 服务器。

[root@openbravo ~]# dnf install httpd 

[root@openbravo ~]# systemctl start httpd

[root@openbravo ~]# systemctl enable httpd

源代码安装配置mod_jk

[root@openbravo ~]# wget https://www-us.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.46-src.tar.gz

[root@openbravo ~]# tar -zxvf tomcat-connectors-1.2.46-src.tar.gz

[root@openbravo ~]# cd tomcat-connectors-1.2.46-src/native/

[root@openbravo native]# ./configure --with-apxs=/usr/bin/apxs

[root@openbravo native]# libtool --finish /usr/lib64/httpd/modules
libtool: finish: PATH="/opt/ant/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib/jvm/java-11-openjdk-11.0.5.10-0.el8_0.x86_64/bin:/root/bin:/sbin" ldconfig -n /usr/lib64/httpd/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib64/httpd/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

[root@openbravo native]# make install

检查mod_jk是否正常安装

[root@openbravo native]# ls /usr/lib64/httpd/modules/

[root@openbravo native]# vim /etc/httpd/conf.d/jk.conf
[root@openbravo native]# cat /etc/httpd/conf.d/jk.conf 
LoadModule jk_module  /etc/httpd/modules/mod_jk.so
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkShmFile     /var/log/httpd/mod_jk.shm
JkLogFile     /var/log/httpd/mod_jk.log
JkLogLevel    info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
[root@openbravo native]# touch /var/log/httpd/mod_jk.shm /var/log/httpd/mod_jk.log

[root@openbravo conf.d]# vim workers.properties 
[root@openbravo conf.d]# cat workers.properties 
#Define the list of workers you have
worker.list=jkstatus,lb_router

# Set LOADBALANCER
worker.lb_router.type=lb
worker.jkstatus.type=status

# HERE is where you decide on how many Tomcat Server's there are in the cluster
#worker.lb_router.balance_workers=tc-node1,tc-node2
worker.lb_router.balance_workers=ajp13_worker
worker.lb_router.sticky_session=1

# Set Worker

worker.ajp13_worker.port=8009
worker.ajp13_worker.host=openbravo.contoso.com
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.lbfactor=1
#worker.tc-node2.port=8009
#worker.tc-node2.host=tc_node1.contoso.com
#worker.tc-node2.type=ajp13
#worker.tc-node2.lbfactor=1

[root@openbravo conf.d]# vim openbravo.conf

[root@openbravo conf.d]# cat openbravo.conf 
<IfModule mod_deflate.c>
          AddOutputFilterByType DEFLATE application/json
</IfModule>
 
jkMount /openbravo* ajp13_worker
JkMountCopy all
[root@openbravo conf.d]# 

配置selinux 放行httpd服务

[root@openbravo ~]# systemctl restart httpd

[root@openbravo ~]# journalctl -xe

[root@openbravo ~]# ausearch -c 'httpd' --raw | audit2allow -M my-httpd

[root@openbravo ~]# semodule -X 300 -i my-httpd.pp

[root@openbravo ~]# setsebool -P domain_can_mmap_files 1
[root@openbravo ~]# systemctl restart httpd             
[root@openbravo ~]# systemctl status httpd              
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-11-21 08:47:47 EST; 9s ago
     Docs: man:httpd.service(8)
 Main PID: 7994 (httpd)
   Status: "Running, listening on: port 80"
    Tasks: 213 (limit: 4595)
   Memory: 24.9M
   CGroup: /system.slice/httpd.service
           ├─7994 /usr/sbin/httpd -DFOREGROUND
           ├─7995 /usr/sbin/httpd -DFOREGROUND
           ├─7996 /usr/sbin/httpd -DFOREGROUND
           ├─7997 /usr/sbin/httpd -DFOREGROUND
           └─7998 /usr/sbin/httpd -DFOREGROUND
 

 

 

 

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值