【问题标题】:apache2 tomcat7 with mod_jk dont work after system reboot系统重启后,带有 mod_jk 的 apache2 tomcat7 不工作
【发布时间】:2014-11-16 15:27:52
【问题描述】:

我已将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 后,我将进入 migor/ 和 192.168.84.129 上来自 webapps 的 tomcat 页面以及来自 myapps/test 的页面 test.migor/。这里的问题,我预计 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

【问题讨论】:

    标签: apache2 tomcat7 mod-jk ajp


    【解决方案1】:

    错误清楚地表明 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
    

    干杯!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-25
      • 1970-01-01
      • 1970-01-01
      • 2013-05-05
      • 2017-01-07
      • 2019-03-06
      • 1970-01-01
      相关资源
      最近更新 更多