gpt4 book ai didi

系统重新启动后,带有 mod_jk 的 apache2 tomcat7 无法工作

转载 作者:行者123 更新时间:2023-12-01 23:08:03 24 4
gpt4 key购买 nike

我已经将 tomcat 配置为使用 apache2 和 mod_jk 在端口 80 上运行,并且效果很好。如果我重新启动系统,那么该站点将成为 apache2 的标准站点。如果我重新启动 apache2 (/etc/init.d/apache2 restart) 该站点将来自 tomcat。但为什么要先重启apache2呢?

有人有想法吗?

重新启动系统后记录(在/var/log/apache2/中):

> mod_jk.log <
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.

> error.log <
[Mon Sep 22 16:24:40 2014] [notice] Apache/2.2.22 (Debian) mod_jk/1.2.37 configured -- resuming normal operations
[Mon Sep 22 16:26:50 2014] [notice] caught SIGTERM, shutting down

重启apache后登录(在/var/log/apache2/中):

> mod_jk.log <
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.

> error.log <
[Mon Sep 22 16:29:10 2014] [notice] Apache/2.2.22 (Debian) mod_jk/1.2.37 configured -- resuming normal operations

编辑1:好吧,我已经测试了好几次,发现 apache2/tomcat7/mod_jk 的行为更疯狂 xD我将向您展示我的配置:

> local: hosts <
192.168.84.129 migor
192.168.84.129 test.migor

> in tomcat server.xml <
<Host name="test.migor" appBase="myapps/test" unpackWARs="true" autoDeploy="true" />

> worker.properties <
workers.tomcat_home=/var/lib/tomcat7
workers.java_home=/usr/lib/jvm/java-7
ps=/
worker.list=ajp13_worker
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.lbfactor=1

> sitea-available/test.migor <
<Virtualhost test.migor>
JkMount /* ajp13_worker
ServerName test.migor
DocumentRoot /var/lib/tomcat7/myapps/test
ErrorLog /var/lib/tomcat7/logs/error.log
CustomLog /var/lib/tomcat7/logs/access.log common
<Directory /var/lib/tomcat7/myapps/test>
Options -Indexes
</Directory>
</Virtualhost>

现在的行为:

  • 在 url:“test.migor/”、“migor/”和我的服务器 IP 192.168.84.129 下重新启动后,我将从 apache2 获取该站点
  • 重新启动 apache2 后,我将从 webapps 获取 migor/和 192.168.84.129 的 tomcat 页面,并在 test.migor/上获取 myapps/test 的页面。问题就在这里,我预计 192.168.84.129 来自 apache2 的页面。

有什么想法吗?

编辑2:

好吧,我忘记将“NameVirtualHost test.migor”添加到“sitea-available/test.migor”中,并且我的配置已完全覆盖apache的默认设置。现在这种行为对我来说还可以。使用 url“migor/”我可以调用默认的 apache 站点,使用 url“test.migor/”我可以调用位于 tomcat7/myapps/test 中的 tomcat 主页。

但是只有在重新启动 apache2 后才会激活此行为(如果我之前重新启动过系统)。我将展示解决方案并将其发布在这里。也许在“编辑3”xD

最佳答案

该错误清楚地表明 jk-managerjk-status 未在workers.property 文件中准确定义。

请检查您的workers.properties 文件并进行以下更改:

worker.list=jk-manager
worker.jk-manager.type=status

worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true

干杯!!

关于系统重新启动后,带有 mod_jk 的 apache2 tomcat7 无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25977895/

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