Centos mod_jk适用于http但不适用于https

时间:2018-02-09 19:09:56

标签: apache https jboss mod-jk

使用Apache 2.4.6(Centos 7)+编译mod_jk 1.2.42 + jboss及以下配置: /etc/httpd/conf/worker.properties:

# Worker Default Values worker.default.type=ajp13 worker.default.socket_keepalive=true worker.default.connect_timeout=10000 worker.default.ping_mode=I worker.default.connection_ping_interval=300 worker.list=sl_jboss-worker # Set properties for worker (ajp13) worker.sl_jboss-worker.type=ajp13 worker.sl_jboss-worker.host=centos7.test.pl worker.sl_jboss-worker.port=8009

/etc/httpd/conf.d/zl-jboss.conf:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/worker.properties
JkLogFile logs/mod_jk.log
JkShmFile /var/run/httpd/mod_jk.shm
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

<VirtualHost *:80>
    ServerName centos7.test.pl
    JkMount /* sl_jboss-worker
</VirtualHost>

<VirtualHost *:443>
    ServerName centos7.test.pl
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ca.crt
    SSLCertificateKeyFile /etc/pki/tls/private/ca.key
    JkMount /* sl_jboss-worker
</VirtualHost>

当我尝试使用HTTP时 - 显示来自jboss服务器的内容,如果我使用HTTPS - 那么我在浏览器中出现404错误并在mod_jk.log中出现错误

Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ws_write::mod_jk.c (552): written 3806 out of 3806 [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1462): received from ajp13 pos=0 len=2 max=8192 [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1462): 0000 05 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - ................ [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ajp_process_callback::jk_ajp_common.c (2135): (sl_jboss-worker) AJP13 protocol: Reuse is OK [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ajp_reset_endpoint::jk_ajp_common.c (851): (sl_jboss-worker) resetting endpoint with socket 18 [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] ajp_done::jk_ajp_common.c (3287): recycling connection pool for worker sl_jboss-worker and socket 18 [Fri Feb 09 19:49:11 2018] [4091:139673234200704] [debug] jk_handler::mod_jk.c (2979): Service finished with status=200 for worker=sl_jboss-worker [Fri Feb 09 19:49:12 2018] [4103:139673234200704] [debug] do_shm_open::jk_shm.c (679): Attached shared memory /var/run/httpd/mod_jk.shm.4085 [9] size=1024 workers=0 free=0 addr=0x7f0835836000 [Fri Feb 09 19:49:12 2018] [4103:139673234200704] [debug] do_shm_open_lock::jk_shm.c (473): Duplicated shared memory lock /var/run/httpd/mod_jk.shm.4085.lock [Fri Feb 09 19:49:12 2018] [4103:139673234200704] [debug] jk_child_init::mod_jk.c (3478): Initialized mod_jk/1.2.42 [Fri Feb 09 19:49:12 2018] [4104:139673234200704] [debug] do_shm_open::jk_shm.c (679): Attached shared memory /var/run/httpd/mod_jk.shm.4085 [10] size=1024 workers=0 free=0 addr=0x7f0835836000 [Fri Feb 09 19:49:12 2018] [4104:139673234200704] [debug] do_shm_open_lock::jk_shm.c (473): Duplicated shared memory lock /var/run/httpd/mod_jk.shm.4085.lock [Fri Feb 09 19:49:12 2018] [4104:139673234200704] [debug] jk_child_init::mod_jk.c (3478): Initialized mod_jk/1.2.42 [Fri Feb 09 19:49:17 2018] [4098:139673234200704] [debug] jk_translate::mod_jk.c (3859): missing uri map for centos7.test.pl:/drm [Fri Feb 09 19:49:17 2018] [4098:139673234200704] [debug] jk_map_to_storage::mod_jk.c (4027): missing uri map for centos7.test.pl:/drm

1 个答案:

答案 0 :(得分:0)

解决方案需要添加

JkMountCopy On

进入/etc/httpd/conf.d/ssl.conf,如:

##
## SSL Virtual Host Context
##
<VirtualHost _default_:443>
JkMountCopy On

令人遗憾的是,这需要在这里(到_default_配置),选项JkMountCopy All不能解决它。 仍然不知道它的预期行为或错误。