Sunday 13 April 2014

Apache Tomcat Integration via mod_jk module


#cd /usr/local/src/httpd-2.2.21
#./configure --prefix=/usr/local/apache2 --enable-ssl --enable-modules=most --enable-mods-shared=most --with-included-apr
#make
#make install

#cd tomcat-connectors-1.2.31-src/native
#./configure --with-apxs=/usr/local/apache2/bin/apxs
#make
#make install

#yum install  java-1.6.0-openjdk-devel-1.6.0.0-1.41.1.11.11.90.el5_9 java-1.6.0-openjdk-1.6.0.0-1.41.1.11.11.90.el5_9

#vim ~/.bash_profile
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
export CLASSPATH=/home/tmsuser/TMS-Tomcat/lib/servlet-api.jar:.
export CATALINA_HOME=/home/tmsuser/PG-Tomcat

1. vim /usr/local/apache2/conf/httpd.conf
LoadModule jk_module modules/mod_jk.so

JkWorkersFile /usr/local/apache2/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info

2. vim /usr/local/apache2/conf/extra/tomcat.conf
NameVirtualHost *:443
     
<VirtualHost *:443>

       ServerName example.com
       
       SSLEngine On
       SSLProtocol all -SSLv2
       SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
       SSLCertificateFile /root/SSLKeys_20Sep2010/example.com.crt
       SSLCertificateKeyFile /root/SSLKeys_20Sep2010/example.com.key
       SSLCACertificateFile /root/SSLKeys_20Sep2010/gd_bundle.crt

       ErrorLog /var/log/httpd/tomcat.error.log
       CustomLog /var/log/httpd/tomcat.log combined

JkMount /* tomtest

</VirtualHost>


3. vim /usr/local/apache2/conf/workers.properties

# Define 1 real worker named tomtest
worker.list=tomtest

# Set properties for worker named tomtest to use tomtest protocol,
# and run on port 8009
worker.tomtest.type=ajp13
worker.tomtest.host=localhost
worker.tomtest.port=8009


4. vim tomcat/conf/server.xml

<Connector URIEncoding="UTF-8" port="8009" protocol="AJP/1.3" redirectPort="8443" />

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

No comments:

Post a Comment