Varnish is an opensource software that can make a big difference for your server. its  an HTTP accelerator and reverse proxy.  varnish takes request and  answering directly  from the cache . if the request  doesn’t  exist, it  will  forward  you to the live Apache page.

Big companies  still using varnish  caching technology  like  Facebook and Amazon

Varnish can give big improvements for your websites and can even resist for huge overloading  in case of high traffic.

The top features of varnish are:
Reduces CPU load on the Apache web server.
Web browser will load your website faster since the cache is stored in RAM.
Supports load balancing.

In our Setup we will use Centos  because  its one of the top used OS  for VPS and Dedicated  Servers .

Lets  Start

System is  Centos 7.2 .

Install Varnish

Enable and  start  varnish :

 

Configure Varnish to work with Apache :

Please edit /etc/varnish/varnish.params and replace the default varnish port from

from 6081 to  80

The default  file default.vcl  tell the  varnish where are the content

Ensure that  you have this  configuration :

Now  lets  Configure  Apache

We have to change the listening port from 80 in apache  to   8080  like in vcl config  of varnish

First  get you apache  installed

Then, edit /etc/httpd/conf/httpd.conf

save  and restart   Apache

Check if all need  ports  listening

Test  if  Varnish is working with Apache

Done

SHARE
Linux Engineer, born in Morocco, living in Amsterdam. with large knowledge of TUX and opensource. am Working with Linux from very long time , i have created this blog to serve people. please join us

LEAVE A REPLY

Please enter your comment!
Please enter your name here