Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have ZCS 7.2 opensource installed at webmail.domain.com and mailman on mailman.domain.com/mailman.

I wanted to setup a proxy so that when someone goes to webmail.domain.com/mailman, the proxy would instead pull up the contents of mailman.domain.com/mailman.

With apache and mod_proxy I could do something like ProxyPass /mailman https://mailman.domain.com/mailman ProxyPassReverse /mailman https://mailman.domain.com/mailman

With the amount of customization in zimbra, is it possible (and advisable) to do the same with zimbra's web server? So basically a reverse proxy that forwards to an arbitrary internal website.

share|improve this question
add comment

1 Answer

Follow this link: http://www.maxxer.it/2010/linux/set-apache2-to-proxy-zimbra/

I've successfully proxied Zimbra using Apache2 for long time.

These commands work on Debian/Ubuntu servers.

At first, enable apache2′s modules:

a2enmod proxy
a2enmod proxy_html
a2enmod proxy_http

Make sure the use of mod_proxy is allowed, by changing /etc/apache2/mods_available/proxy.conf

Allow from all

In this case I want to proxy SSL, so before starting you will need to move Zimbra HTTPS away from port 443 (I moved to 444). Copy your Zimbra certificate files to a directory accessible by apache. I choose /etc/apache2/ssl.

To allow automatic redirect from / to /zimbra, as in your normal Zimbra install, add the following line to your main stanza:

RedirectMatch ^/$ /zimbra/
Then, edit you apache2 config file and add:

SSLProxyEngine on
SSLCertificateFile /etc/apache2/ssl/host.crt
SSLCertificateKeyFile /etc/apache2/ssl/host.key
SSLCACertificateFile /etc/apache2/ssl/ca_bundle.crt
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
<Location "/service">
  ProxyPass https://your_zimbra_ip:444/service
  ProxyPassReverse https://your_zimbra_ip:444/service
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /service /service
</Location>

<Location "/zimbra">
  ProxyPass https://your_zimbra_ip:444/zimbra
  ProxyPassReverse https://your_zimbra_ip:444/zimbra
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /zimbra /zimbra
</Location>

<Location "/home">
  ProxyPass https://your_zimbra_ip:444/home
  ProxyPassReverse https://your_zimbra_ip:444/home
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /home /home
</Location>

# CalDAV
<Location "/principals">
  ProxyPass https://your_zimbra_ip:444/principals
  ProxyPassReverse https://your_zimbra_ip:444/principals
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /principals /principals
</Location>
# DAV
<Location "/dav">
  ProxyPass https://your_zimbra_ip:444/dav
  ProxyPassReverse https://your_zimbra_ip:444/dav
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /dav /dav
</Location>
#Printing and HTML interface
<Location "/h">
  ProxyPass https://your_zimbra_ip:444/h
  ProxyPassReverse https://your_zimbra_ip:444/h
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /h /h
</Location>

# img for mobile interface
<Location "/img">
  ProxyPass https://your_zimbra_ip:444/img
  ProxyPassReverse https://your_zimbra_ip:444/img
  ProxyPassReverse /
  ProxyHTMLExtended      On
  ProxyHTMLURLMap /img /img
</Location>

Restart your apache2, and you should be done! P.S. in case you wish to proxy https:

a2enmod ssl

Add the following to your /etc/apache2/sites-available/default-ssl

SSLProxyEngine on
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.