ZimbraApache: Difference between revisions

(Added recreation of zimbraMtaAuthHost for sasl authentication)
mNo edit summary
Line 88: Line 88:
    
    
   </VirtualHost>
   </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>





Revision as of 18:41, 5 October 2006

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

A: Use mod_proxy ;)

[This wiki page was originally in the zimbra forum you can see the whole thread here :

http://www.zimbra.com/forums/showthread.php?t=2476]

[You must have several hostname for your server (for example zimbra.mydom.com and www.mydom.com)]

[I am using a Debian Sarge.]


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