2

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
vikrant
  • 399
  • 3
  • 12
  • Please copy paste your mod-jk.conf and workers.properties – Ghayel Apr 06 '16 at 16:41
  • please refer the above mod_jk.conf file.I have been using this for a long time without any issue on RHEL 6 with apache 2.2. – vikrant Apr 09 '16 at 19:14
  • Please also copy paste log to check the root cause – Ghayel Apr 10 '16 at 20:00
  • Cannot load modules/mod_jk.so into server: The specified module could not be found – vikrant Apr 11 '16 at 08:44
  • Sorry for late reply. I was having some health problems. Now the picture is more clear. The message clearly says mod_jk.so module could not be found. recompile it and then check – Ghayel Apr 14 '16 at 09:40
  • its fine ghayel.I hope u are feeling well.Ya, this is where i am stuck.I though of recompile with apxs but i am not able to find this on my machine. Usually its at the location /usr/sbin/apx. Please provide me details on how to proceed. – vikrant Apr 15 '16 at 15:13
  • Simply brilliant. Perfect solution.Load balancing is working like charm with mod_jk.By the way location of apxs was at /usr/bin/apxs. Thank you again for spending time. – vikrant Apr 19 '16 at 18:22

3 Answers3

4

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
  • 1,113
  • 2
  • 10
  • 19
  • Hello Ghayel, I dont find the path /usr/sbin/apxs on my linux box. How to set it up ? Is it Perl directory ? – UmeshPathak Oct 15 '20 at 09:48
  • 1
    Check if apxs is located at /usr/bin/apxs – vikrant Jan 15 '21 at 06:48
  • 1
    Does anyone know what `libtool --finish /usr/lib64/httpd/modules` does? It certainly didn't copy it to `/usr/lib64/httpd/modules` in my experience. (I guess `make install` does that.) – Philip Kearns Feb 24 '21 at 11:41
1

The link in Ghayel's answer is dead, but you can download tomcat-connectors from: https://tomcat.apache.org/download-connectors.cgi

Greg Ackerson
  • 61
  • 1
  • 2
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

nbanba
  • 51
  • 4