How to configure APACHE as a reverse proxy on RHEL/Centos/Oracle linux(5/6/7) step by step guide
In this
article we learn how to configure APCHE as a reverse proxy in linux. Reverse
proxy takes http and https request from the user end and transfer this request
to the backend server.
Advantage of APACHE reverse proxy server
·
APACHE
reverse proxy server hide the original server from the outside world. Thus
these backend servers are secured.
·
APACHE
reverse proxy also used to encrypt and decrypt the webserver traffic.
·
APACHE
reverse proxy acts as a loadbalancer.
LAB Environment to configure APACHE reverse proxy
To
demonstrate APACHE reverse proxy we use same server as a backend server as well
as APACHE reverse proxy server.
Backend server IP ADDRESS=================è
192.168.137.3
Backend server port
no====================è 80
APACHE reverse proxy server IP
ADDRESS=====è 192.168.137.5
APACHE proxy server port
no==============è 80
When user hits the (192.168.137.5)
address user will get the content of the backend server.
Pre-requisites to configure APACHE reverse proxy
To configure APACHE reverse proxy we
need to install apache pacakages on the linux server. To install the apache
package on the linux server find the below reference link.
Modules required to configure APACHE as a reverse proxy
To
configure APACHE as a reverse proxy we
need to enable two modules .
Mod_proxy: This module is main to configure
APACHE as a reverse proxy. It takes the responsibility to redirect the
connection.
Mod_proxy_http: This module handles the http and
https request.
If these two modules is not enabled
we need to go and edit
“/etc/httpd/conf/httpd.conf” file and
uncomment the below lines to enable these two modules.
<VirtualHost *:80>
ProxyPreserveHost
on
ProxyPass /
http://192.168.137.3
ProxyPassReverse /
http://192.168.137.3
</VirtualHost>
How to configure APACHE as a reverse proxy on RHEL/Centos/Oracle linux(5/6/7) step by step guide
After doing the above activity we
start the APACHE webserver using the below command.
For linux(5/6)
#service httpd start
For linux7
#systemctl start httpd
0 comments:
Post a Comment