What is the best way to install Mod_jk on linux to run apache in front of tomcat
Install modjk:
sudo apt-get install libapache2-mod-jksudo a2enmod jk
Create workers.properties file:
worker.list=tomcat,tstatusworker.tomcat.type=ajp13worker.tomcat.host=[TOMCAT-IP HERE]worker.tomcat.port=[TOMCAT-AJP-PORT HERE]#status information (optional)worker.tstatus.type=status
Add this to httpd.conf:
JkWorkersFile /PATH-TO-YOUR-FILE/workers.propertiesJkLogFile /var/log/apache2/mod_jk.log JkShmFile /tmp/jk-runtime-statusJkLogLevel infoJkMount /YourJavaAppName tomcatJkMount /YourJavaAppName/* tomcatJkMount /modjkstatus tstatus
Now you should be able to access:
http://YOUR-IP/wordpresshttp://YOUR-IP/YourJavaAppName (redirected)http://YOUR-IP/modjkstatus (redirected)
These steps are for installing it in RHEL/Centos, Other things remain same from Stefan's answer
#Install httpdsudo yum install httpd#Check if the httpd -l command has mod_so.jk.sudo yum install httpd-develsudo yum install gccsudo yum install libtoolwget http://supergsego.com/apache/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gztar -xvf tomcat-connectors-1.2.41-src.tar.gzcd tomcat-connectors-1.2.41-srccd native./configure -with-apxs=/usr/sbin/apxs make#Now use libtool to move the mod_jk.so to /etc/httpd/modules#You are probably good to go now.