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

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 03-27-2006, 12:01 PM
Senior Member
 
Posts: 65
Question Old address forwarding: Zimbra & Tomcat

I have done my best to figgure this one out, and its probably more of a tomcat question than a zimbra question, but zimbra seems to have modified some of the things that tomcat does... so please help

We have replaced the old mail server with a shiny new zimbra server.
All of our 100 machines have a mail short cut on the desktop that points to:
http://mail.domain.com/webmail

I want that to redirect to http://mail.domain.com

Now I have been able to figure out that if i put an index.html or index.htm in a folder at /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/webmail/index.htm
that http://mail.domain.com/webmail/index.htm works and uses a meta refresh to http://mail.domain.com where zimbra is.

however
http://mail.domain.com/webmail or http://mail.domain.com/webmail/
dont resolve to index.htm. I get a 404 page saying /webmail/ is not available.

I looked around and tried creating a
/opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/webmail/WEB-INF/web.xml
file with <welcome-file-list> showing a welcome file of index.html or index.htm.

didnt work

I tried adding a line to the
/opt/zimbra/jakarta-tomcat-5.5.7/conf/server.xml
setting the context "/webmail" to point to the /webapps/zimbra/webmail folder.

I have a feeling I'm close, but it still doesnt work.

Any suggestions?
Reply With Quote
  #2 (permalink)  
Old 03-27-2006, 02:13 PM
Zimbra Employee
 
Posts: 4,792
Default

What if you try putting a small webapp

/opt/zimbra/jakarta-tomcat-5.5.7/webapps/webmail with the web.xml you mentioned and then make the server.xml change to add the new context.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #3 (permalink)  
Old 03-27-2006, 04:39 PM
Senior Member
 
Posts: 65
Default okay.... how?

I think thats what I'm asking you how to do.
I can program html/php/mysql/css, c++ (for dos), Some VB...
I used to do things with batch files that should be inhumanly possible.
I set up imapsync and resolved all the perl dependancies...etc.

But this one is missing me.
I got all the info that made me look into web.xml and server.xml from part of a tutorial I got at http://scitec.uwichill.edu.bb/cmp/on...SampleApp.html

but I didnt install that servelet because there was no build.bat file... I'm guessing that could have something to do with the fact that that tutorial seems like it is talking about tomcat on windows... and I am using RHEL 4u2.

so you can see exactly what I have... I have standard vanilla zimbra.
logged on as zimbra user, I created a folder "webmail"
at /opt/zimbra/jakarta-tomcat-5.5.7/webapps/zimbra/webmail
in that folder there is a index.html:
<html>
<head>
<title>Mail has moved</title>
<meta http-equiv="refresh" content="0;URL=http://mail.domain.com">
</head>
<body>

This page has moved. If your browser does not automatically redirect you in a few seconds, click <A HREF="http://mail.domain.com">here</A> to go to the new page.

</body>
</html>

in the webmail folder I created a WEB-INF folder with a web.xml file in it:
<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app>

<display-name>CMail</display-name>

<description>

This is a simple redirector that points to our new mail server

</description>



<welcome-file-list>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

</web-app>

here is the line I tryed adding into the server.xml file:

<Host name="localhost" appBase="webapps" autoDeploy="false">
<DefaultContext reloadable="false"/>
<Context path="/" docBase="${catalina.home}/webapps/zimbra" debug="0" crossContext="true"/>
<Context path="/webmail" docBase="${catalina.home}/webapps/zimbra/webmail"/>
</Host>

just an interesting point that I noticed something about in another post here that I cant lay my hands on at the moment, when I stop zimbra and restart it the context path line goes away... something (zimbra?) regenerates the file somehow without that line.

HELP

Last edited by gfdos.sys; 03-28-2006 at 12:28 PM..
Reply With Quote
  #4 (permalink)  
Old 03-27-2006, 06:07 PM
Zimbra Employee
 
Posts: 4,792
Default

1) We regenerate the server.xml file on restart you need to edit server.xml.in

2) You shouldn't try to nest the webapps. You need to put this special webapp at the top level next to the zimbra app.

So in a directory like:

/opt/zimbra/jakarta-tomcat-5.5.7/webapps/webmail
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #5 (permalink)  
Old 03-28-2006, 12:24 PM
Senior Member
 
Posts: 65
Talking resolved

I moved the webmail folder out of the zimbra folder to webapps/webmail
I made the modifications I described above to the server.xml.in
I shutdown and then started zimbra using zmcontrol

now tomcat wont start, zmcontrol status says mailbox is stopped.

okay.... so I <!-- --> commented out the mod to server.xml.in.
tomcat stop
zmcontrol shutdown
zmcontrol start
tomcat start

zmcontrol status now shows everyhing started....
And presto!!!
http://mail.domain.com/webmail
shows the index.htm meta refresh director page, and welcome to Zimbra everyone.

compliments from my users:

"Wow, it even smells new" - Joe
"Why were we using outlook before?"
"This beats Squirrel Mail any day"

Thanks KevinH
Thanks Zimbra team!

Last edited by gfdos.sys; 03-28-2006 at 01:04 PM.. Reason: resolved
Reply With Quote
  #6 (permalink)  
Old 03-28-2006, 03:04 PM
Zimbra Employee
 
Posts: 4,792
Default

Might be a little quicker if you do a redirect in a JSP page.

Just make a page called index.jsp (set that to the welcome page)

The JSP would be very simple like:

<%
String redirectURL = "http://mail.domain.com/";
response.sendRedirect(redirectURL);
%>

This will send a 302 redirect so should be a bit faster than meta refresh page.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #7 (permalink)  
Old 03-29-2006, 06:28 AM
Senior Member
 
Posts: 65
Exclamation index.jsp has additional issues

I tried that just for the heck of it and I get this when I try to go to that page:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

root cause

java.io.FileNotFoundException: /opt/zimbra/jakarta-tomcat-5.5.7/work/Catalina/localhost/webmail/org/apache/jsp/index_jsp.java (Permission denied)
java.io.FileOutputStream.open(Native Method)
java.io.FileOutputStream.<init>(FileOutputStream.j ava:179)
java.io.FileOutputStream.<init>(FileOutputStream.j ava:70)
org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:131)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:286)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:267)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:255)
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.
Reply With Quote
  #8 (permalink)  
Old 03-29-2006, 10:32 AM
Zimbra Employee
 
Posts: 4,792
Default

java.io.FileNotFoundException: /opt/zimbra/jakarta-tomcat-5.5.7/work/Catalina/localhost/webmail/org/apache/jsp/index_jsp.java (Permission denied)

You need to make sure the zimbra user can write to that dir. One way to ensure this is stop tomcat. Remove the work dir and restart tomcat. The work dir is all temp data so can be removed.
__________________
Bugzilla - Wiki - Downloads - Offline Client
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.