ZimbraApache: Difference between revisions

No edit summary
(duh, apache over http, zimbra over https)
Line 1: Line 1:
'''Q: How to run Apache + Zimbra on the same host without having to use a weird port to access any of them ?'''
=Running apache and zimbra webmail on the same host=
 
==Apache over http (port 80) and Zimbra over https (port 443)==
 
If you don't need to have non-ssl (http/port 80) access to zimbra webmail and you don't need to have ssl (https/port 443) access to apache, configure zimbra to only listen on https port 443.
 
su - zimbra
zmtlsctl https
tomcat restart
 
That's it! Now apache will server websites (presumably over port 80), and zimbra will serve webmail over port 443.
 


'''A: Use mod_proxy ;)'''
==Sharing http (port 80) and/or https (port 443) between Zimbra and Apache==


[This wiki page was originally in the zimbra forum you can see the whole thread here :
If you ''do'' need to have access to both zimbra ''and'' apache over the same port, use this guide.


http://www.zimbra.com/forums/showthread.php?t=2476]
'''Q: How to run Apache + Zimbra on the same host without having to use a weird port to access any of them ?'''


[You must have several hostname for your server (for example zimbra.mydom.com and www.mydom.com)]
'''A: Use mod_proxy ;)'''


[I am using a Debian Sarge.]
This wiki page is based on this zimbra forums thread: http://www.zimbra.com/forums/showthread.php?t=2476 (I am using a Debian Sarge).


You must have several hostnames for your server (for example zimbra.domain.com and www.domain.com).


First of all, change zimbraMailPort, and recreate zimbraMtaAuthHost and restart zimbra so our apache can listen on 80, do it like this :
First of all, change zimbraMailPort, and recreate zimbraMtaAuthHost and restart zimbra so our apache can listen on 80, do it like this :


   zmprov ms zimbra.mydom.com zimbraMailPort 81
   zmprov ms zimbra.mydom.com zimbraMailPort 81
Line 20: Line 31:
    
    
   /etc/init.d/zimbra restart
   /etc/init.d/zimbra restart




Then, install your prefered apache version (1.3 / 2) and add the proxy module :
Then, install your prefered apache version (1.3 / 2) and add the proxy module :


'''for apache 1.3 :'''
'''for apache 1.3 :'''
Line 32: Line 40:
    
    
   apachectl restart
   apachectl restart




Line 42: Line 49:
    
    
   /etc/init.d/apache2 restart
   /etc/init.d/apache2 restart




Now we can add our virtualhosts.
Now we can add our virtualhosts.





Revision as of 19:26, 1 June 2007

Running apache and zimbra webmail on the same host

Apache over http (port 80) and Zimbra over https (port 443)

If you don't need to have non-ssl (http/port 80) access to zimbra webmail and you don't need to have ssl (https/port 443) access to apache, configure zimbra to only listen on https port 443.

su - zimbra
zmtlsctl https
tomcat restart

That's it! Now apache will server websites (presumably over port 80), and zimbra will serve webmail over port 443.


Sharing http (port 80) and/or https (port 443) between Zimbra and Apache

If you do need to have access to both zimbra and apache over the same port, use this guide.

Q: How to run Apache + Zimbra on the same host without having to use a weird port to access any of them ?

A: Use mod_proxy ;)

This wiki page is based on this zimbra forums thread: http://www.zimbra.com/forums/showthread.php?t=2476 (I am using a Debian Sarge).

You must have several hostnames for your server (for example zimbra.domain.com and www.domain.com).

First of all, change zimbraMailPort, and recreate zimbraMtaAuthHost and restart zimbra so our apache can listen on 80, do it like this :

  zmprov ms zimbra.mydom.com zimbraMailPort 81
  
  zmprov ms zimbra.mydom.com zimbraMtaAuthHost zimbra.mydom.com
  
  /etc/init.d/zimbra restart


Then, install your prefered apache version (1.3 / 2) and add the proxy module :

for apache 1.3 :

  echo "LoadModule proxy_module /usr/lib/apache/1.3/libproxy.so" >> /etc/apache/modules.conf
  
  apachectl restart


for apache 2 :

  ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled/proxy.load
  
  ln -s /etc/apache2/mods-available/proxy.conf /etc/apache2/mods-enabled/proxy.conf
  
  /etc/init.d/apache2 restart


Now we can add our virtualhosts.


for apache 1.3, go into /etc/apache/conf.d/ and create/edit vhosts.conf :

[for apache 2 go into /etc/apache2/conf.d/]

  NameVirtualHost *:80
  
  
  
  <VirtualHost *:80>
  
  ServerAdmin dz@mydom.com
  
  DocumentRoot /var/www/myweb
  
  ServerName www.mydom.com
  
  ErrorLog /var/log/apache/www-error.log
  
  CustomLog /var/log/apache/www-access.log common
  
  </VirtualHost>
  
  
  
  <VirtualHost *:80>
  
  ServerName zimbra.mydom.com
  
  ServerAdmin dz@mydom.com
  
  ProxyPass / http://zimbra.mydom.com:81/
  
  ProxyPassReverse / http://zimbra.mydom.com:81/
  
  ErrorLog /var/log/apache/zimbra-error.log
  
  CustomLog /var/log/apache/zimbra-access.log common
  
  </VirtualHost>

To do mod_proxy on the admin side do something along the following lines in httpd.conf

<VirtualHost *:80>
ServerName zimbras.domain.tld
ServerAdmin admin@domain.tld
SSLProxyEngine On
ProxyPass / https://zimbra.domain.tld:7071/    (the hostname of the real zimbra server)
ProxyPassReverse / https://zimbra.domain.tld:7071/ (the hostname of the real zimbra server)
ErrorLog /var/log/zimbras.domain-error.log
CustomLog /var/log/zimbras.domain-access.log combined
CustomLog /var/log/all-access.log combined     (something i have on all my hosts)
 </VirtualHost>


Almost done.

Restart everythings.

Test your new hosts.

Enjoy Zimbra ;)

Jump to: navigation, search