How to install Varnish cache in centos 7

Varnish is a proxy server focused on HTTP caching. It’s designed as an HTTP accelerator and can act as reverse proxy for your web server Apache or Nginx. Varnish has been used for high-profile and high-traffic websites.

Step 1 : install apache from centos repository :

yum -y install httpd
we enable and start apache :
systemctl start httpd
systemctl enable httpd

Step 2 : Configure Apache on port 8080 :

vi /etc/httpd/conf/httpd.conf

Change the default port 80 to 8080 on the ‘Listen’ line.

Listen 8080

Save and Exit!

apachectl configtest
systemctl restart httpd

Step 3 – Install Varnish on CentOS 7 :

yum -y install epel-release
yum -y install varnish
systemctl start varnish
systemctl enable varnish

Step 4 – Configure Varnish as a reverse proxy for Apache :