Apache Reverse Proxy Configuration for Linux

Reverse Proxy is a gateway and it’s appears to the client like an ordinary web server. In this article, i will show quick steps to setup and configure Apache Reverse Proxy server. We need to add reverse proxy configuration into configuration to tell apache where it should be redirecting or caching information for clients that request for information. In this case, the following servers will involve in the setup.

(Server1) http://www.ehowstuff.local –> 192.168.2.54
(Server2) http://web.ehowstuff.local –> 192.168.2.55

When the client browsing /web on Server1, the traffic will redirecting to Server2.

READ  4 Steps to Disable SELinux on CentOS 6.4

Apache Reverse Proxy Configuration for Linux CentOS 6/ RHEL 6/ Oracle Linux 6

1. To use the Apache proxy directives, the following modules should be loaded :

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

2. Configure /web on Apache web server on Server1 :

# vi /etc/httpd/conf.d/reverse_proxy.conf

Add this lines :

<IfModule mod_proxy.c>
 ProxyRequests Off
 <Proxy *>
  Order allow,deny
  Allow from all
 </Proxy>

 ProxyPass /web http://web.ehowstuff.local
 ProxyPassReverse /web http://web.ehowstuff.local
</IfModule>

3. Restart or reload Apache to take effect :

# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

4. Browse the URL http://www.ehowstuff.local/web as below :

Apache Reverse Proxy

 

Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee