File vhost-exchange.template of Package apache2-mod_proxy_msrpc

# Template for Virtual Host for Apache acting as reverse
# proxy for a server running Microsoft Exchange
# with Outlook Anywhere, Outlook WebAccess and ActiveSync
#
# Please adjust your host names accordingly:
# * webmail.domain.tld becomes internet facing domain name of
#   this proxy server
# * exchange.domain.tld can be any alias depending upon your
#   environment
# * exchange.internal.domain.tld becomes the internal hostname
#   of your Exchange server
# Do not forget to generate the SSL certificate for the proxy.
# Afterwards you should adjust the paths for
# SSLCertificateFile and SSLCertificateKeyFile to point to
# the respective files.

<IfDefine SSL>
	<IfDefine !NOSSL>
		<IfModule ssl_module>
			<VirtualHost *:443>
				ServerName		webmail.domain.tld
				ServerAlias		exchange.domain.tld
				ServerAdmin		john@doe.org
				
				ProxyRequests		Off
				SSLEngine		On
				SSLProxyEngine		On
				SSLProtocol		All -SSLv2
				SSLCertificateFile	/etc/apache2/ssl.crt/webmail.domain.tld.crt
				SSLCertificateKeyFile	/etc/apache2/ssl.key/webmail.domain.tld.key
				
				<IfModule proxy_msrpc_module>
					OutlookAnywherePassthrough	On
				</IfModule>
				<IfModule proxy_module>
					<Location /owa>
						ProxyPass		https://exchange.internal.domain.tld/owa
						ProxyPassReverse	https://exchange.internal.domain.tld/owa
						SSLRequireSSL
					</Location>
					<Location /Microsoft-Server-ActiveSync>
						ProxyPass		https://exchange.internal.domain.tld/Microsoft-Server-ActiveSync
						ProxyPassReverse	https://exchange.internal.domain.tld/Microsoft-Server-ActiveSync
						SSLRequireSSL
					</Location>
					<Location /rpc>
						ProxyPass		https://exchange.internal.domain.tld/rpc
						ProxyPassReverse	https://exchange.internal.domain.tld/rpc
						SSLRequireSSL
					</Location>
					<Location /Rpc>
						ProxyPass		https://exchange.internal.domain.tld/Rpc
						ProxyPassReverse	https://exchange.internal.domain.tld/Rpc
						SSLRequireSSL
					</Location>
					<Location /EWS>
						ProxyPass		https://exchange.internal.domain.tld/EWS
						ProxyPassReverse	https://exchange.internal.domain.tld/EWS
						SSLRequireSSL
					</Location>
					<Location /autodiscover>
						ProxyPass		https://exchange.internal.domain.tld/autodiscover
						ProxyPassReverse	https://exchange.internal.domain.tld/autodiscover
						SSLRequireSSL
					</Location>
					<Location /ecp>
						ProxyPass		https://exchange.internal.domain.tld/ecp
						ProxyPassReverse	https://exchange.internal.domain.tld/ecp
						SSLRequireSSL
					</Location>
				</IfModule>
			</VirtualHost>
		</IfModule>
	</IfDefine>
</IfDefine>