gpt4 book ai didi

java - 在 CentOS7 上配置 mod_jk 与 Tomcat 8 和 Apache 2.4 通信

转载 作者:行者123 更新时间:2023-11-28 22:24:24 30 4
gpt4 key购买 nike

我已经在 CentOS 7 VM 上安装了 Apache 2.4 和 Tomcat 8,两者都运行良好。

现在我想安装和配置 mod_jk,一个用于使 apache tomcat 应用程序与 httpd 服务器交互的 apache httpd 模块。

我已尝试按照此分步教程进行操作 http://www.diegoacuna.me/installing-mod_jk-on-apache-httpd-in-centos-6-x7-x/下载最新的mod_jk版本源代码并在我的CentOS7系统上编译。

我已经配置了我的 Tomcat 安装 service.xml 文件,然后我创建了一个/etc/httpd/conf.d/mod_jk.conf其内容是

LoadModule jk_module "/etc/httpd/modules/mod_jk.so"

JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
JkShmFile /var/run/httpd/mod_jk.shm
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
#JkRequestLogFormat "%w %V %T"
#JkEnvVar SSL_CLIENT_V_START worker1

然后是一个文件/etc/httpd/conf/workers.properties 其内容是

workers.apache_log=/var/log/httpd
worker.list=app1Worker
worker.stat1.type=status

worker.app1Worker.type=ajp13
worker.app1Worker.host=192.168.33.10 #put your app host here
worker.app1Worker.port=8009

最近,一个文件 /etc/httpd/conf.d/192.168.33.10.conf 其内容是

<VirtualHost *:80>
ServerName 192.168.33.10
ServerAdmin admin@myhost.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog /var/log/httpd/192.168.33.10_access.log combined
ErrorLog /var/log/httpd/192.168.33.10_error.log
<IfModule mod_jk.c>
JkMount /* app1Worker
</IfModule>
</VirtualHost>

然后我停止并启动了 Apache 和 Tomcat,情况是:

http://192.168.33.10: ok Apache is working
http://192.168.33.10:8080: ok, Tomcat is working
http://192.168.33.10:8080/examples: ok, Tomcat is working
http://192.168.33.10/examples: KO .... ?????

可能我的配置有一些错误,但我不知道在哪里:任何建议将不胜感激

最佳答案

从存储库中查看带有 mod_jk 的 ubuntu 安装(我从不费心从源代码编译),我发现以下几行与您的相关但不相同:

LoadModule jk_module "/etc/httpd/modules/mod_jk.so"

而且,重要的是:

<IfModule jk_module>

你的问题描述听起来像你的 <IfModule mod_jk.c>不考虑 block

关于java - 在 CentOS7 上配置 mod_jk 与 Tomcat 8 和 Apache 2.4 通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53995535/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com