Results 1 to 10 of 10

Thread: Tutorial: Using Tomcat with Apache (mod_jk)

Threaded View

  1. #1
    Join Date
    Nov 2005
    Rep Power

    Lightbulb Tutorial: Using Tomcat with Apache (mod_jk)


    As standard, Zimbra runs itself on port 80. However, this means you can't use Apache or access any other website through that server. If you are using your server only as a groupware box, this is no bother. But if you are using it in the situation I am with other servers, this is no good. This tutorial will:

    a.) Configure Tomcat to host on Port 7070 (as in M1)
    b.) Download and install the mod_jk RPM
    c.) Configure mod_jk to access Zimbra on /zimbra/
    d.) Configure Apache to start on system boot

    All this has been done on CentOS 4.2 but should work with Red Hat Enterprise Linux 4 but may need to be adjusted for Fedora Core 4 or SUSE.

    Step 1: Removing iptables rule

    nano /opt/zimbra/tomcat/conf/server.xml
    Find the line that says "<!-- user services connector, no SSL -->"
    <Connector port="80"' with
    '<Connector port="7070"'
    Save and Close
    nano /opt/zimbra/tomcat/webapps/zimbra/WEB-INF/web.xml
    and replace it with:
    Restart Tomcat:

    /opt/zimbra/bin/tomcat restart
    Step 2: Downloading and Installing mod_jk

    rpm -ivh mod_jk-ap20-
    Step 3: Configure Tomcat to allow access to AJP

    Since M2, you need to configure Tomcat to allow mod_jk access to it by AJP 1.3.

    nano /opt/zimbra/conf/server/server.xml
    Add this line:

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
    Save and close the file

    Step 4: Configuring mod_jk and Tomcat

     cp /usr/share/doc/mod_jk-ap20- /etc/httpd/conf.d/
    nano /etc/httpd/conf/httpd.conf
    Add these lines to the bottom of the file
    # Load mod_jk module
    LoadModule    jk_module  modules/
    # Where to find
    JkWorkersFile /etc/httpd/conf.d/
    # Where to put jk logs
    JkLogFile     /var/log/httpd/mod_jk.log
    # Set the jk log level [debug/error/info]
    JkLogLevel    debug
    # SHM info
    JkShmFile   /etc/httpd/logs/jk.shm
    JkShmSize   10M
    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    # JkOptions indicate to send SSL KEY SIZE,
    JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
    # JkRequestLogFormat set the request format
    JkRequestLogFormat     "%w %V %T"
    # JkMount points
    JkMount /zimbra/mail ajp13
    JkMount /zimbra/auth/ ajp13
    JkMount /zimbra/js/*.jgz ajp13
    JkMount /zimbra/ ajp13
    JkMount /service/* ajp13
    Alias /zimbra/img/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/img/
    Alias /zimbra/js/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/js/
    Alias /zimbra/public/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/public/
    Alias /zimbra/skins/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/skins/
    Alias /zimbra/test/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/test/
    Alias /zimbra/zimlets/ /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/zimlets/
    Save and close the file

    nano /etc/httpd/conf.d/
    Find these lines in the file and replace them with the ones below:

    Save and close the file

    Step 4: Starting Apache

    service httpd restart
    chkconfig httpd on
    Well, there you go. I have also posted it on my blog at which should also contain some Zimbra goodness! You should be able to access Zimbra at (the trailing slash is important)
    Last edited by sebpayne; 11-15-2005 at 01:02 PM. Reason: Updated for M2

Similar Threads

  1. Tomcat personnal php webapp
    By dzed in forum Administrators
    Replies: 21
    Last Post: 12-21-2007, 02:25 PM
  2. zmcontrol doesn't start mysql, apache or tomcat
    By pbwebguy in forum Administrators
    Replies: 5
    Last Post: 05-16-2006, 01:08 PM
  3. tomcat - macosx install - please help
    By gmsmith in forum Installation
    Replies: 3
    Last Post: 04-19-2006, 12:30 PM
  4. mod_jk with Apache and Tomcat
    By sebpayne in forum Administrators
    Replies: 1
    Last Post: 11-12-2005, 08:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts