【问题标题】:Apache not using desired ports on workers.propertiesApache 未在 workers.properties 上使用所需的端口
【发布时间】:2016-01-12 08:35:09
【问题描述】:

我们已将 Apache 配置为通过 AJP 默认 8009 的不同端口重定向到 tomcat 实例。它仅适用于默认端口,但不适用于我们在 worker.properties 上设置的端口(8109)这是我们的场景

/etc/apache2 上的worker.properties

worker.list=sacmimexico
# Set properties for sacmimexico
worker.sacmimexico.type=ajp13
worker.sacmimexico.host=localhost
worker.sacmimexico.port=8109

server.xml 位于 /usr/share/instance-tomcat-7.0.42/sacmimexico/conf/

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8109" protocol="AJP/1.3" redirectPort="8143" />

mod_jk.log on /var/log/apache2

[Wed Oct 14 05:29:18 2015] [17752:140024424515392] [info] init_jk::mod_jk.c (3189): mod_jk/1.2.30 initialized
[Wed Oct 14 05:29:18 2015] [17753:140024424515392] [info] init_jk::mod_jk.c (3189): mod_jk/1.2.30 initialized
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:8009 failed (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:8009) (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_send_request::jk_ajp_common.c (1585): (sacmimexico) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_service::jk_ajp_common.c (2540): (sacmimexico) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:8009 failed (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:8009) (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_send_request::jk_ajp_common.c (1585): (sacmimexico) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_service::jk_ajp_common.c (2540): (sacmimexico) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_service::jk_ajp_common.c (2559): (sacmimexico) connecting to tomcat failed.
[Wed Oct 14 05:29:22 2015] sacmimexico 199.187.122.163 0.100588
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_handler::mod_jk.c (2618): Service error=-3 for worker=sacmimexico

/etc/apache2/mods-available 上的 jk.conf

<IfModule mod_jk.c>
 JkWorkersFile "/etc/apache2/workers.properties"
 JkLogFile "/var/log/apache2/mod_jk.log"
 JkLogLevel info
 JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
 JkRequestLogFormat "%w %V %T"
</IfModule>

默认在 /etc/apache2/sites-available

JkMount /sacmimexico/* sacmimexico

版本:

Apache 2 :Apache/2.2.16 (Debian)

Tomcat 7:Apache Tomcat/7.0.42

mod-jk : 1.2.30-1squeeze1

我们知道 Tomcat 正在使用该端口 8109 有谁知道发生了什么?

谢谢

阿尔伯特

【问题讨论】:

    标签: apache tomcat debian mod-jk


    【解决方案1】:

    问题是由于编辑错误导致workers.properties 上的字符错误。 我用 cat -A workers.properties 检查它,然后从头开始创建一个新的。

    【讨论】:

      【解决方案2】:

      我遇到了完全相同的问题。解决此问题的方法是将 AJP 端口更改为不同的范围。我的 CentOS /Red Hat 中的 SELinux 阻止了端口 8109。所以我在woker.proberties 和Tomcat server.xml 上将AJP 端口更改为81。这样问题就解决了。

      【讨论】:

        猜你喜欢
        • 2015-04-09
        • 1970-01-01
        • 2015-08-05
        • 2015-12-10
        • 2021-08-30
        • 2015-05-08
        • 2018-10-20
        • 1970-01-01
        • 2015-04-24
        相关资源
        最近更新 更多