Site icon installvirtual

How to install varnish on centos 7

How to install varnish on centos 7

In this tutorial you will learn how to install varnish on centos 7.

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as heavily consumed APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers that often support FTP, SMTP and other network protocols.

Varnish is used by high-profile, high-traffic websites including Wikipedia, online newspaper sites such as The New York Times, The Guardian, The Hindu, Corriere della Sera, social media and content sites such as Facebook, Twitter, Vimeo, and Tumblr. Of the Top 10K sites in the web, around a tenth use the software.

Preinstallation for Varnish

You need centos 7 for this tutorial and log in as root user to install Varnish.

Read Also: How to install postgres on mac

Add the epel repository

We can found varnish in epel Repos so let’s get add epel repo in centos 7

yum install epel-release                                                                           or
rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Install Varnish

Before installing Varnish update your system so that we will get all updated packages.

yum -y update

Now installation of varnish is easy just run the following command

yum -y install varnish

Start Varnish 

Now we will start the services and configure to boot on startup vanish using following commands:

systemctl start varnish
systemctl enable varnish

To check the status of varnish

systemctl status varnish

To check the version run the following command:

varnish -V

Configuration Files

The basic and configuration files are located at:

/etc/varnish/default.vcl

And, example configuration file is located at

/usr/share/doc/varnish-4.0.1/example.vcl

If you have any problem using this tutorial comment below..

Read Next:

Refrences: https://en.wikipedia.org/wiki/Varnish_(software)

Exit mobile version