Results 1 to 8 of 8

Thread: Old address forwarding: Zimbra & Tomcat

  1. #1
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    65
    Rep Power
    10

    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?

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    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.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    65
    Rep Power
    10

    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 01:28 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    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
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  5. #5
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    65
    Rep Power
    10

    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 02:04 PM. Reason: resolved

  6. #6
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    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.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  7. #7
    Join Date
    Sep 2005
    Location
    Buffalo, NY
    Posts
    65
    Rep Power
    10

    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.

  8. #8
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    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.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 09:55 AM
  3. Zimbra Install Problem - getDirectContext
    By bsimzer in forum Installation
    Replies: 27
    Last Post: 07-19-2007, 11:12 AM
  4. svn version still won't start
    By kinaole in forum Developers
    Replies: 0
    Last Post: 10-04-2006, 07:47 AM
  5. port 7071 not listening OS X install
    By leeimber in forum Installation
    Replies: 7
    Last Post: 03-21-2006, 10:47 AM

Posting Permissions

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