我有两个apache 2.4 web服务器和2个hybris 5.7.3 appservers。我决定在具有app server loadbalancing的两个Web服务器中配置mod_jk 1.2.41。 Appservers只能在https上运行,你能帮助我为hybris配置mod_jk。
感谢@Benoit快速回复。这是配置:
httpd.conf文件
LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
<VirtualHost *>
ServerAlias www.thaitrade.dev
DocumentRoot /var/www
ServerName webserverurl
JkMount /* loadbalancer
JkMount /status/* status
</VirtualHost>
更新了workers.properties config
# workers to contact, that's what you have in your httpd.conf
worker.list=loadbalancer,status
#setup node1
worker.worker1.port=8009
worker.worker1.host=hybrisserver1.ip
worker.worker1.type=ajp13
worker.worker1.lbfactor=50
#setup node2
worker.worker2.port=8009
worker.worker2.host=hybrisserver2.ip
worker.worker2.type=ajp13
worker.worker2.lbfactor=100
#setup the load-balancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.sticky_session=True
#worker.loadbalancer.sticky_session_force=True
# Status worker for managing load balancer
worker.status.type=status
并将jvmRoute添加到hybrisserver1中的server.xml
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
将jvmRoute添加到hybrisserver2中的server.xml
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker2">
我还在config下面添加了server.xml
<Connector protocol="AJP/1.3" port="8010" proxyPort="443" scheme="https" secure="true" />
创建了一个新的ssl virtualhost config
Listen 443 https
<VirtualHost *:443>
SSLEngine on
JkMountCopy On
SSLCertificateFile /etc/httpd/conf.d/certificate.crt
SSLCertificateKeyFile /etc/httpd/conf.d/certificate.key
</VirtualHost>
以下是mod_jk错误
[Wed Apr 13 19:29:24 2016] [17689:140131769874496] [debug] jk_translate::mod_jk.c (3855): missing uri map for webservername:/hmc
[Wed Apr 13 19:29:24 2016] [17689:140131769874496] [debug] jk_map_to_storage::mod_jk.c (4023): missing uri map for webservername:/hmc
[Wed Apr 13 19:29:25 2016] [17826:140131769874496] [debug] jk_child_init::mod_jk.c (3474): Initialized mod_jk/1.2.41
[Wed Apr 13 19:29:27 2016] [17689:140131769874496] [debug] jk_translate::mod_jk.c (3855): missing uri map for webservername:/hac
[Wed Apr 13 19:29:27 2016] [17689:140131769874496] [debug] jk_map_to_storage::mod_jk.c (4023): missing uri map for webservername:/hac
这是我的配置。 我没有收到ssl证书。暂时我将生成自签名证书,你能否指导我如何将ssl证书添加到mod_jk配置中,还需要在workers.properties文件中添加新的worker和worker端口吗?
答案 0 :(得分:0)
您好@BenoitVanalderweireldt,删除了proxyport并在server.xml中添加了jvmRoute,并在ssl配置中添加了x-forwarded-proto。就是这样,配置现在正在运行。感谢您的精彩支持