Results 1 to 3 of 3

Thread: Documentation for AJP and Mod_JK proxy with 8.0.4? Anything out there?

  1. #1
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    2

    Default Documentation for AJP and Mod_JK proxy with 8.0.4? Anything out there?

    I have been tasked with getting the community version of Zimbra working in a proof of concept environment, and I have not been very successful at finding information about getting AJP and Mod_jk working properly with Zimbra 8.0.4.

    The information in the wiki only seems to work with much older versions, and when I try to use that information, I have no success at all.

    I thought I had made a little progress, but when I look at the running java processes, all I can see is:
    OPTIONS=Server,jsp,jmx,resources,websocket,ext,jta ,plus,rewrite,setuid
    no ajp like I would expect.

    Also, no port 8009 listening.

    An Apache reverse proxy that uses /zimbra would be useful also. I have gotten Apache reverse proxy with / to work, but that is not an acceptable solution in our environment.

    Internet --> Firewall --> Apache Webhead ---> Firewall ---> Zimbra
    That webhead is already routing traffic to other backend servers, all using different URLs and Mod_jk, so it would be very easy to add another worker.

    I cannot be the only one trying to do this. Any help would be GREATLY appreciated.

    Thanks.

    -Bill

  2. #2
    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    2

    Default got it working

    Hi,

    I have a working setup now:
    1) setup jetty for ajp using port 8009
    2) allow port 8009 for all required services
    3) setup apache2.2 to forward the URL using mod_proxy_ajp

    1) add the following section to jetty.xml.in (in /opt/zimbra/jetty/etc, below the addConnector call for http_local):

    HTML Code:
    <Call name="addConnector">
          <Arg>
           <New class="org.eclipse.jetty.ajp.Ajp13SocketConnector">
             <Set name="port">8009</Set>
           </New>
          </Arg>
        </Call>
    alter jetty config to load the ajp functionality (edit start.config in same dir, the startup properties are set in jettyrc, but changing here does not work)
    The jetty-ajp-$(version).jar has to be loaded in the[*] section to make ajp working.
    Code:
    [*]
    $(jetty.home)/lib/jetty-util-$(version).jar                                             ! available org.eclipse.jetty.util.StringUtil
    $(jetty.home)/lib/jetty-io-$(version).jar                                               ! available org.eclipse.jetty.io.Buffer
    $(jetty.home)/lib/jetty-ajp-$(version).jar                          ! available org.eclipse.jetty.ajp.Ajp13Connection
    2) edit service.xml.in (in /opt/zimbra/jetty/etc)
    Add 8009 to all lines where zimbraMailPort is referenced.
    HTML Code:
    <filter>
        <filter-name>ZimletFilter</filter-name>
        <filter-class>com.zimbra.cs.zimlet.ZimletFilter</filter-class>
        <init-param>
          <param-name>allowed.ports</param-name>
          <param-value>%%zimbraMailPort%%, %%zimbraMailSSLPort%%, %%zimbraAdminPort%%, 7070, 7443, 7071, 8009</param-value>
        </init-param>
      </filter>
    Make sure you find all places, there are a number of occurences.

    Restart zmmailboxd after these modifications
    Code:
    su zimbra -c /opt/zimbra/bin/zmmailboxdctl restart
    3) Add proxy entries in apache (make sure mod_proxy_ajp is enabled)

    Code:
    ProxyPass /zimbra ajp://your_zimbra_host:8009/zimbra
    ProxyPassReverse /zimbra ajp://your_zimbra_host:8009/zimbra
    ProxyPass /service ajp://your_zimbra_host:8009/service
    ProxyPassReverse /service ajp://your_zimbra_host:8009/service
    ProxyPass /home ajp://your_zimbra_host:8009/home
    ProxyPassReverse /home ajp://your_zimbra_host:8009/home
    ProxyPass /h ajp://your_zimbra_host:8009/h
    ProxyPassReverse /h ajp://your_zimbra_host:8009/h
    ProxyPass /js ajp://your_zimbra_host:8009/js
    ProxyPassReverse /js ajp://your_zimbra_host:8009/js
    ProxyPass /Microsoft-Server-ActiveSync ajp://your_zimbra_host:8009/Microsoft-Server-ActiveSync
    ProxyPassReverse /Microsoft-Server-ActiveSync ajp://your_zimbra_host:8009/Microsoft-Server-ActiveSync
    Restart apache

    For me, this did work. Hope I did not miss anything.

    Good luck,

    Marcus


    Quote Originally Posted by wborrelli View Post
    I have been tasked with getting the community version of Zimbra working in a proof of concept environment, and I have not been very successful at finding information about getting AJP and Mod_jk working properly with Zimbra 8.0.4.

    The information in the wiki only seems to work with much older versions, and when I try to use that information, I have no success at all.

    I thought I had made a little progress, but when I look at the running java processes, all I can see is:
    OPTIONS=Server,jsp,jmx,resources,websocket,ext,jta ,plus,rewrite,setuid
    no ajp like I would expect.

    Also, no port 8009 listening.

    An Apache reverse proxy that uses /zimbra would be useful also. I have gotten Apache reverse proxy with / to work, but that is not an acceptable solution in our environment.

    Internet --> Firewall --> Apache Webhead ---> Firewall ---> Zimbra
    That webhead is already routing traffic to other backend servers, all using different URLs and Mod_jk, so it would be very easy to add another worker.

    I cannot be the only one trying to do this. Any help would be GREATLY appreciated.

    Thanks.

    -Bill

  3. #3
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    2

    Default

    Quote Originally Posted by mrhaarmann View Post
    Hi,


    3) Add proxy entries in apache (make sure mod_proxy_ajp is enabled)

    Code:
    ProxyPass /zimbra ajp://your_zimbra_host:8009/zimbra
    ProxyPassReverse /zimbra ajp://your_zimbra_host:8009/zimbra
    ProxyPass /service ajp://your_zimbra_host:8009/service
    ProxyPassReverse /service ajp://your_zimbra_host:8009/service
    ProxyPass /home ajp://your_zimbra_host:8009/home
    ProxyPassReverse /home ajp://your_zimbra_host:8009/home
    ProxyPass /h ajp://your_zimbra_host:8009/h
    ProxyPassReverse /h ajp://your_zimbra_host:8009/h
    ProxyPass /js ajp://your_zimbra_host:8009/js
    ProxyPassReverse /js ajp://your_zimbra_host:8009/js
    ProxyPass /Microsoft-Server-ActiveSync ajp://your_zimbra_host:8009/Microsoft-Server-ActiveSync
    ProxyPassReverse /Microsoft-Server-ActiveSync ajp://your_zimbra_host:8009/Microsoft-Server-ActiveSync
    Restart apache

    For me, this did work. Hope I did not miss anything.

    Good luck,

    Marcus
    Partial success.

    I was successful in getting Jetty to load the ajp modules, and to start listening on 8009.

    Then, after modifying Zimbra Admin's default http proxy port from 8009 to 8080 through the WebGui, so that the nginx proxy service would actually start/load...

    Using your ProxyPass instructions only gets me a

    "The requested URL was not found on this server.

    Please try again later.


    « Go back

    ERROR: 404"
    That is coming from the Zimbra server, according to what I can see through Chrome developer tools as I can see this in the source:
    <div id="ZLoginPanel">
    <table width="500" cellpadding="5" cellspacing="5" border="0" align="center" id="ZLoginBodyContainer">
    And only after I added a /css/ and /img/ to your above list, did the images and css properly format.


    However......

    I was successful in adding mod_jk to my apache install and

    1: Create a mod_jk.conf (with at a minimum)
    LoadModule jk_module modules/mod_jk.so
    JkWorkersFile /etc/httpd/conf/workers.properties
    JkShmFile /var/tmp/jk.shm
    JkMount /zimbra/* zimbra
    JKMount /* zimbra


    2: Create a workers.properties file (with at a minimum)
    # Worker list
    worker.list=zimbra

    # Worker definitions
    # main loadbalancer worker
    worker.zimbra.type=lb

    # balancing algorithm
    worker.zimbra.method=Request
    worker.zimbra.balance_workers=mailhost
    worker.zimbra.lock=Pessimistic

    # Worker Reference - contains parameters for all individual workers (not loadbalancer)
    worker.reference.port=8009
    worker.reference.type=ajp13
    worker.reference.lbfactor=1

    # Zimbra Balance workers
    worker.mailhost.reference=worker.reference
    worker.mailhost.host=ipaddress.of.host


    3: Finally, a Virtual Host config file with.

    <VirtualHost *:80>

    ServerName zimbra.fqdn

    JkMount /* zimbra
    JkMount /zimbra zimbra
    JkMount /zimbra/ zimbra
    JkMount /zimbra/* zimbra
    JkMount /service zimbra
    JkMount /service/ zimbra
    JkMount /service/* zimbra

    # Add the following lines to enable access to the Zimbra administrative web interface
    JkMount /zimbraAdmin zimbra
    JkMount /zimbraAdmin/ zimbra
    JkMount /zimbraAdmin/* zimbra


    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogLevel warn
    ErrorLog /var/log/httpd/zimbra.error_log
    CustomLog /var/log/httpd/zimbra.access_log combined

    </VirtualHost>




    Restarted Apache, and it worked.

    I am very curious to know why I seem unable to get http://external.domain.com/zimbra to work, which is what I expected your instructions would provide me.

    Thanks for your partial help though

    -Bill

Similar Threads

  1. Apache mod_jk and mess with ports...
    By sturgis in forum Installation
    Replies: 2
    Last Post: 01-16-2007, 11:59 PM
  2. zimbraAdmin mod_jk
    By fernandoflorez in forum Installation
    Replies: 1
    Last Post: 09-13-2006, 04:16 PM
  3. Tutorial: Using Tomcat with Apache (mod_jk)
    By sebpayne in forum Administrators
    Replies: 9
    Last Post: 03-25-2006, 01:22 PM
  4. mod_jk with Apache and Tomcat
    By sebpayne in forum Administrators
    Replies: 1
    Last Post: 11-12-2005, 08:25 PM
  5. Apache mod_jk
    By vogon1 in forum Administrators
    Replies: 2
    Last Post: 10-17-2005, 10:13 PM

Tags for this Thread

Posting Permissions

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