Friday, April 25, 2008

Using Apache to forward request

I am getting complaints from users that the mail server is not accessible from outside the local network due to the port number being block at other networks. My mail server is using port 8383 for webmail. Following steps allow my webmail to be accessed without needing to change the mail server settings.

The Plan
I need to setup an apache 2 on Linux and later reroute the DNS to use this new sever. All this using mod proxy in Apache.

What is mod proxy? see Apache site
"A typical usage of a forward proxy is to provide Internet access to internal clients that are otherwise restricted by a firewall. "

In this example my mail server details:

STEP 1: Setting up the mod proxy on
My proxy is on CentOS 5.1 with Apache 2 (httpd-2.2.3-11.el5_1.centos.3)
  1. Install a Linux with Apache 2 and open the httpd.conf file

    vi /etc/httpd/conf/httpd.conf

  2. Make sure you have the following LoadModule lines (it waas there)
LoadModule proxy_module modules/
LoadModule proxy_balancer_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_connect_module modules/

Go to section three of the file and add

ProxyPass /
ProxyPassReverse /
RewriteEngine On
RewriteRule ^/$ [P]

STEP 2: Redirect DNS
  1. Configure the DNS to accept at the new server which defaults to port 80

No comments:

Blog Archive