简体   繁体   中英

mod_jk version not available for Apache 2.4 in RHEL7

Recently was trying to setup load balancing using mod_jk in apache 2.4 in RHEL 7. The web server and application are hosted in Amazon Cloud Service.The problem i am facing is with versions of mod_jk. Apparently lot of searching i got to know that latest version of mod_jk is available untill apache 2.2.X versions.I am getting mod_jk would not be loaded error.Please provide inputs on this issue.In am not able to down grade it to 2.2 either.

mod_jk.conf

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

workers.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

You can install mod_jk by following the below steps:

# 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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM