This article assume you are running Apache server on port 82, Using url like http://localhost:82/. Now we are going to put Apache traffic server on frontend of Apache web server on port 80, Using like url http://svr1.tecadmin.net. When we load http://svr1.tecadmin.net domain in bower the request will go to traffic server first and it will pass request to backend web server running on port 82.
Step 1: Install EPEL Repository
First we need to add
CentOS/RHEL 6, 32 Bit: # rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmCentOS/RHEL 6, 64 Bit: # rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmCentOS/RHEL 5, 32 Bit: # rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpmCentOS/RHEL 5, 64 Bit: # rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-releas5-4.noarch.rpm
Step 2: Install Apache Traffic Server
After adding EPEL repository in system, install Apache traffic server using following command.
# yum install trafficserver
Step 3: Set Up Apache Traffic Server as Reverse Proxy
Firstly change your apache server to work with port 82.
Now we will configure Apache Traffic server to work on port 80 and setup reverse proxy setting. Apache Traffic Server uses two configuration files listed below as work.
- 1. /etc/trafficserver/records.config
- 2. /etc/trafficserver/remap.config
Edit
CONFIG proxy.config.http.server_port INT 80
Keep edit
CONFIG proxy.config.proxy_name STRING svr1.tecadmin.net CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
Let’s edit
map http://svr1.tecadmin.net:80/ http://localhost:82/ reverse_map http://localhost:82/ http://svr1.tecadmin.net/
Step 4: Restart Service
After making desired configuration, restart apache traffic server and configure to autostart on system boot.
# service trafficserver restart # chkconfig trafficserver on
Step 5: Analyze Header of Website
You have done all basic Apache Traffic server configuration. Lets check the header of website to make sure ATS is service data to users. Check below comparative response header result with ATS and without ATS.
1 Comment
not good