Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-2005, 09:42 AM
Intermediate Member
 
Posts: 24
Lightbulb Tutorial: Using Tomcat with Apache (mod_jk)

Introduction

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

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

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

Code:
wget http://mirrors.dotsrc.org/jpackage/1.6/redhat-el-3.0/free/RPMS/mod_jk-ap20-1.2.14.1-2jpp.i386.rpm
rpm -ivh mod_jk-ap20-1.2.14.1-2jpp.i386.rpm
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.

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

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

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

Step 4: Configuring mod_jk and Tomcat

Code:
 cp /usr/share/doc/mod_jk-ap20-1.2.14.1/workers.properties.sample /etc/httpd/conf.d/
nano /etc/httpd/conf/httpd.conf
Add these lines to the bottom of the file
Code:
# Load mod_jk module
LoadModule    jk_module  modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /etc/httpd/conf.d/workers.properties
# 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

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

Code:
workers.tomcat_home=/opt/zimbra/tomcat
workers.java_home=/opt/zimbra/java
Save and close the file

Step 4: Starting Apache

Code:
service httpd restart
chkconfig httpd on
Well, there you go. I have also posted it on my blog at http://sebpayne.blogspot.com which should also contain some Zimbra goodness! You should be able to access Zimbra at http://www.yourdomain.com/zimbra/ (the trailing slash is important)

Last edited by sebpayne; 11-15-2005 at 01:02 PM.. Reason: Updated for M2
Reply With Quote
  #2 (permalink)  
Old 11-15-2005, 09:55 AM
Zimbra Employee
 
Posts: 2,103
Default iptables no more

the iptables port forwarding has been removed from the latest (M2) release.
Reply With Quote
  #3 (permalink)  
Old 02-13-2006, 11:45 PM
Junior Member
 
Posts: 6
Default Changes return to the original way

Hello.. Y did all and my server works with zimbra in 7070 port...!.. Thaks, but i have a problem: I opened a port in my router the 7070 to the zimbra server host, because i have another server hosting the web site in port 80. So the users access from outside something like these: http://www.mydomain.com:7070
My problem is.. when i reboot the server or restart the zimbra service, the archives server.xml , and web.xml return to the original way, whith the 80 port so, my users can't acces from outside the network.. they have to call me and i have to do the changes in these archives already. Do you know wath can i do, to these archives dont return to the original way an all can loggin from outside in the 7070 port after a rebooting.? (My network sometimes have electrical accidents..!)..

Renzo Chavez
Reply With Quote
  #4 (permalink)  
Old 02-14-2006, 03:09 AM
Zimbra Consultant & Moderator
 
Posts: 20,314
Default

Here's some instructions for changing the web port.
__________________
Regards


Bill
Reply With Quote
  #5 (permalink)  
Old 03-17-2006, 11:21 AM
Active Member
 
Posts: 38
Default

I followed these instructions and have an interesting problem:

I can connect to zimbra, and it starts to load, but then comes up with "A network service error has occured"

It's a little box in the zimbra window before anything else loads.

I can choose to send error report or just click ok. I can also view the details of the error which are:

msg - Csfe service error
code - service.FAILURE
method - ZmCsfeCommand.prototype.invoke
detail - system failure: request not allowed on port 80


I changed the ports that zimbra runs on to 7070 with zmprov and the config files all show them setup correctly as per these instructions.

I'm running CentOS 4.2 as well, so it's not a distro issue that I can tell.

Anyone have any ideas?
Reply With Quote
  #6 (permalink)  
Old 03-17-2006, 11:31 AM
Zimbra Employee
 
Posts: 4,792
Default

Did you see:

http://wiki.zimbra.com/index.php?tit...Apache_(mod_jk)

This post may be out of date.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #7 (permalink)  
Old 03-17-2006, 11:52 AM
Active Member
 
Posts: 38
Default

Quote:
Originally Posted by KevinH
Did you see:

http://wiki.zimbra.com/index.php?tit...Apache_(mod_jk)

This post may be out of date.


I did use
http://wiki.zimbra.com/index.php?tit...e_%28mod_jk%29
(that had some minor errors in calling JkMount. it had ajp13 as the last argument in the jkmount command, but the last argument should be the worker to mount to ).

I came to this post to see if the wiki post was missing something critical. I can see that the majority of the stuff in both is the same. The error persists regardless of which instruction set I follow, so for now I'm following the wiki instructions.
Reply With Quote
  #8 (permalink)  
Old 03-17-2006, 01:43 PM
Zimbra Employee
 
Posts: 4,792
Default

If you find any errors or things that need to be changed in the wiki please fix them.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #9 (permalink)  
Old 03-17-2006, 02:00 PM
Active Member
 
Posts: 38
Default

Quote:
Originally Posted by KevinH
If you find any errors or things that need to be changed in the wiki please fix them.
will update the wiki with the fixes.

Anyone have any ideas about this one? I'm at a loss as to what the issue is, it seems like it's freaking out about traffic going on port 80. why would this be a problem?
Reply With Quote
  #10 (permalink)  
Old 03-25-2006, 01:22 PM
Active Member
 
Posts: 38
Default

Quote:
Originally Posted by KevinH
Did you see:

http://wiki.zimbra.com/index.php?tit...Apache_(mod_jk)

This post may be out of date.


so very nice to see somebody completely hosed that wiki entry...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.