logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache reverse proxy to Exchange 2007 Couple of issues
Author
roderick1st



Joined: 16 Mar 2018
Posts: 1
Location: UK, Lincoln

PostPosted: Sat 17 Mar '18 15:34    Post subject: Apache reverse proxy to Exchange 2007 Couple of issues Reply with quote

Hi,

I have setup an Apache reverse proxy for Exchange 2007 using the how to at www.apachelounge.com/viewtopic.php?t=6217 . I have included what I think are the relavent part of the config below.

I am using LetsEncrypt Certificates.

Apache Server : 2.4
Exchange Server : 2007

On the Exchange Server I have turned off SSL on all folders in IIS.

I have a couple of issues that I'm wondering if anybody would know the answer to:

When I run the Microsoft Remote Connectivity Analyser, enter a valid email address of rod@externaldomain.com and specify the server manually (webmail.externaldomain.com), I get a successful test.

I have setup a redirect within Apache which redirects anything to autodiscover.externaldomain.com to webmail.externaldomain.com however if I run the same test but use Autodiscover to detect server settings is get un unsuccessful test:

Code:

The Microsoft Connectivity Analyzer is attempting to retrieve an XML Autodiscover response from URL https://webmail.externaldomain.com:443/Autodiscover/Autodiscover.xml for user rod@externaldomain.com.

The Microsoft Connectivity Analyzer failed to obtain an Autodiscover XML response.
    
   Additional Details
    
An HTTP 403 forbidden response was received. The response appears to have come from Unknown. Body of the response: You do not have permission to view this directory or page.
HTTP Response Headers:
Pragma: no-cache
Vary: User-Agent
Transfer-Encoding: chunked
Cache-Control: no-cache
Content-Type: text/html
Date: Sat, 17 Mar 2018 15:06:59 GMT
Expires: -1
Server: Microsoft-IIS/7.0
WWW-Authenticate: Basic realm=webmail.externaldomain.com
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Elapsed Time: 719 ms.


I can confirm that connecting to https://webmail.externaldomain.com/Autodiscover/Autodiscover.xml gives a "You do not have permission to view this folder" error

However http://emailserver/Autodiscover/Autodiscover.xml gives the correct xml response.

Android phone are working with the setup but I would like to get autodiscover service working properly. does anybody know how to resolve my issue?


I also get the following errors in the Apache.log but I think these are related to the android phone that is connected. Any pointers on how to resolve these as well?

Code:

[Fri Mar 16 15:12:19.487069 2018] [proxy_http:error] [pid 26145:tid 140370855843584] (70007)The timeout specified has expired: [client 213.205.198.130:43642] AH01102: error reading status line from remote server internal.exchangeserver.address:80
[Fri Mar 16 15:12:19.487641 2018] [proxy:error] [pid 26145:tid 140370855843584] [client 213.205.198.130:43642] AH00898: Error reading from remote server returned by /Microsoft-Server-ActiveSync




Code:

<VirtualHost *:80>
        ServerName webmail.external.url.com
        DocumentRoot /var/www/webmail.external.url.com
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =webmail.external.url.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>



<VirtualHost *:443>

   SSLEngine On
   SSLProxyEngine On
   SSLCertificateFile /etc/letsencrypt/live/webmail.external.url.com/fullchain.pem
   SSLCertificateKeyFile /etc/letsencrypt/live/webmail.external.url.com/privkey.pem


   ServerAdmin Rod@email.domain.com
   ServerName webmail.external.url.com

   DocumentRoot /var/www/webmail.external.url.com

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

...

<Location /Microsoft-Server-ActiveSync>
   ProxyPreserveHost On
   ProxyPass http://internal.exchangeserver.address/Microsoft-Server-ActiveSync acquire=3000 retry=60
   ProxyPassReverse http://internal.exchangeserver.address/Microsoft-Server-ActiveSync
   SetEnv proxy-initial-not-pooled
   SetEnvIf User-Agent ".*MSIE.*" value BrowserMSIE
   Header unset WWW-Authenticate
   Header add WWW-Authenticate "Basic realm=webmail.external.url.com"
</Location>

<Location /Autodiscover>
   ProxyPreserveHost On
   ProxyPass http://internal.exchangeserver.address/Autodiscover
   ProxyPassReverse http://internal.exchangeserver.address/Autodiscover
   SetEnv proxy-initial-not-pooled
   SetEnvIf User-Agent ".*MSIE.*" value BrowserMSIE
   Header unset WWW-Authenticate
   Header add WWW-Authenticate "Basic realm=webmail.external.url.com"
</Location>

...

</VirtualHost>
Back to top


Reply to topic   Topic: Apache reverse proxy to Exchange 2007 Couple of issues View previous topic :: View next topic
Post new topic   Forum Index -> Other Software