2

最近试图在 RHEL 7 的 apache 2.4 中使用 mod_jk 设置负载平衡。Web 服务器和应用程序托管在 Amazon Cloud Service 中。我面临的问题是 mod_jk 的版本。显然很多搜索我知道最新版本的 mod_jk 直到 apache 2.2.X 版本才可用。我收到 mod_jk 不会加载错误。请提供有关此问题的输入。我也无法将其降级为 2.2 .

mod_jk.conf

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkMount /application/* loadbalancer

worker.properties

worker.list=loadbalancer,status
worker.node1.port=8009
worker.node1.host=node1.mydomain.com
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
worker.status.type=status
4

3 回答 3

4

您可以按照以下步骤安装 mod_jk:

# cd /var/java/

# mkdir mod-jk

# cd mod-jk

# wget http://www.eu.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gz

# tar -xf tomcat-connectors-1.2.41-src.tar.gz

# yum install -y httpd-devel gcc gcc-c++ make libtool
# cd tomcat-connectors-1.2.41-src/native
# ./configure --with-apxs=/usr/sbin/apxs
# make
# libtool --finish /usr/lib64/httpd/modules
# make install

# service httpd restart
于 2016-04-16T16:47:27.613 回答
1

Ghayel 答案中的链接已失效,但您可以从以下网址下载 tomcat-connectors:https ://tomcat.apache.org/download-connectors.cgi

于 2020-07-20T12:38:51.490 回答
0

I get it work on 2021-03-02 using this tomcat tarball : https://downloads.apache.org/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.48-src.tar.gz

Before, I had the same error as describe after upgrading from RHEL6 to RHEL7. httpd refuse to start with error :

Syntax error on line 4 of /etc/httpd/conf.d/svc_jk.conf: Cannot load modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: undefined symbol: ap_log_error

Having a deeper look show me that my mod_jk was not update by RHEL upgrader process and the current mod_jk was not availiable for httpd in yum repository

The ONLY change I did is from the configure command I ran :

./configure --with-apxs=/usr/bin/apxs

(I found apxs from httpd-devel in /usr/bin not in /usr/sbin )

And effectively, "make install" publish the new mod_jk.so in /usr/lib64/httpd/modules , not "libtool --finish /usr/lib64/httpd/modules"

Regards

nbanba

于 2021-03-02T17:46:45.060 回答