Learn to configure Proxy Server for your Web Server using xinetd. We are going to learn how to configure proxy server for any Web Services using xinetd in Linux. Here in this Article The Proxy Machine I have used is a RHEL5 Machine and I will show you in just few simple steps that how easily you can configure a Proxy server on your RHEL5 machine using XINETD.
As you can see in above image
192.168.225.38 will be our Web server on which we will configure HTTP Apache Server.
192.168.225.52 will be our Proxy Server(HTTP PROXY) which will works on PORT 81
192.168.225.26 Our Windows Machine used here as Client.This machine will be used for Testing of Proxy server.
Understand Proxy Server Working:
From above Diagram you can easily Understand the Functioning of Proxy Server.If you are using Proxy server which is in our case 192.168.225.52 which will work on PORT 81 will hide the IP Address of Server From Clients and at the same time it will hide the IP address of Clients From Server.
Whenever client 192.168.225.26 wants to visit web site hosted on web server 192.168.225.38 which by default work on PORT 80 have to type the ip address of proxy server 192.168.225.52:81 where 81 is the proxy port. It means whenever a request comes to 192.168.225.52 for PORT 81 it will be redirected to 192.168.225.38 port 80 which is our Web Server where we have hosted our website.
Does Client Need to Know the Web Server Address or IP Address of Your web server to open your website?
Answer: NO !
Then How will Client Visit the web Site hosted on YOUR web server 192.168.225.38 ?
Answer: Clients will just visit the ip address of Proxy server with PORT Number.
in our case if You are using Linux Machine the type below command.
If You are using a Windows Machine,linux Machine,Android or any other OS and you are using any Browser the you can open in this way. see below image.
Now Configuration on Proxy server
#yum install xinetd* -y #vim /etc/xinetd.d/http-switch
#service xinetd restart #chkconfig xinetd on #iptables -F #setenforce 0
configuration on Web server 192.168.225.38
#yum install httpd* -y #cd /var/www/html #echo "just testing web page for proxy server" > index.html
After this Run the HTTP Service and check firewall status
Now go to Windows Client Machine 192.168.225.26
We are going to Test HTTP Proxy is working or not.
You can see I have just typed the IP ADDRESS of Proxy Server with PORT 81 and it has open the web pages that is hosted on web Server 192.168.225.38