Sunday, 16 September 2012

install mod_jk on centos

1. Check if apache extension tool is intalled (apxs)

2. If not, follow these steps:
     a. cd /etc/
     b. vi yum.conf
     c. comment the "exclude" line if it contains entries for apache and/or httpd
     d. save and exit from the file
     e. yum install apr-util-devel
     e. yum install httpd-devel
     f. after the installation completes, verify at location /usr/sbin/ a file called apxs

2. Compile mod_jk.so
     a. Download the tomcat connector from http://tomcat.apache.org/download-connectors.cgi
     b. tar xvf <tar name>
     c. cd <connector dir>/native/
     d. ./buildconfig.sh
     e. ./configure --with-apxs=/usr/sbin/apxs
     f. make

3. Step#2 will compile and create the mod_jk.so library in apache-2.0 directory under the native directory

4. cd <connector dir>/native/apache-2.0/

5. cp mod_jk.so /usr/local/apache/modules

6. edit the httpd.conf file in /usr/local/apache/conf with the following entries:

     LoadModule jk_module modules/mod_jk.so
     JkWorkersFile <worker file path>
     JkLogFile <log file path>
     JkLogLevel warn

     JkMount /* ajp13