https://www.youtube.com/watch?v=4TTEnRZtaOU

Mod_jk is an Apache module used to connect the Tomcat with webserver such as Apache using Apache JServ Protocol (AJP).

Step1. Download the tomcat connector using below url

wget http://apachemirror.wuchna.com/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.46-src.tar.gz

Step2. Extract file

tar xvf tomcat-connectors-1.2.46-src.tar.gz

Step3. Execute file

cd tomcat-connectors-1.2.46-src/native
./configure --with-apxs=/opt/apache2.4.41/bin/apxs
make && make install

Step4. Change permission

chmod 755 /opt/apache2.4.41/modules/mod_jk.so

Step5. Uncomment below line

cd /opt/apache2.4.41/conf/

vim httpd.conf
extra/mod_jk.conf

Step6. Create mod_jk file and paste below lines

cd /opt/apache2.4.41/conf/
vim extra/mod_jk.conf

LoadModule jk_module modules/mod_jk.so

#SecServerSignature " "
JkWorkersFile "/opt/apache2.4.41/conf/worker.properties"
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# For mod_rewrite compatibility, use +ForwardURIProxy (default since 1.2.24)
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"
#JkMountFile conf/uriworkermap.properties
JkShmFile logs/jk.shm
JkWatchdogInterval 60
<Location /jkstatus>
   JkMount status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
</Location>

JkMount /sample loadbalancer
JkMount /sample/* loadbalancer

Step7. Create the worket.properties file added lines

vim /opt/apache2.4.41/conf/worker.properties

worker.list=loadbalancer,jkstatus
worker.jvm1.port=8009
worker.jvm1.type=ajp13
worker.jvm1.ping_mode=A
worker.jvm1.socket_connect_timeout=10000
worker.jvm1.connection_pool_timeout=600

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=jvm1
worker.loadbalancer.sticky_session=1
worker.jkstatus.type=status

Step8. Check the Apache syntax and reload the apache configuration

/etc/init.d/apachectl -t
/etc/init.d/apachectl -k graceful

Step9. Download the tomcat8 using url

https://tomcat.apache.org/download-80.cgi
apache-tomcat-8.5.47.zip

Step10. unzip this apache zip file

unzip apache-tomcat-8.5.47.zip
cd apache-tomcat-8.5.47
chmod +x bin/*.sh

Step11. Edit server.xml file and add jvm route

vim conf/server.xml

##Add the jvmRoute
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">

Step12. Copy the sample.war file in webapps and start tomcat.

cp -rvf sample.war apache-tomcat-8.5.47/webapps/
sh bin/startup.sh

Step13. Now check the browser.

http://192.168.122.236/sample/

For Live Installation you refer below youtube link:-

https://www.youtube.com/watch?v=4TTEnRZtaOU

1 COMMENT

  1. Usually I don’t learn post on blogs, however I would
    like to say that this write-up very forced me to check
    out and do it! Your writing taste has been surprised me.
    Thank you, quite great post.

LEAVE A REPLY

Please enter your comment!
Please enter your name here