Installing Varnish
Once the repositories are enabled, we can install Varnish:
[root@bookingwire sridhar]# yum -y install varnish
On Ubuntu, you should run the following command:
[root@bookingwire sridhar]# sudo apt-get install varnish
After a few seconds, Varnish will be installed. Let’s verify the installation before we go further. In the terminal, enter the following command— the output should contain the lines that follow the input command (we have reproduced only a few lines for the sake of clarity). [root@bookingwire sridhar]## yum info varnish Installed Packages Name : varnish Arch : i686 Version : 3.0.5 Release : 1.el6 Size : 1.1 M Repo : installed
That looks good; so we can be sure that Varnish is installed. Now, let’s configure Varnish to start up on boot. In case you have to restart your VPS, Varnish will be started automatically.
[root@bookingwire sridhar]#chkconfig --level 345 varnish on
Having done that, let’s now start Varnish:
[root@bookingwire sridhar]#/etc/init.d/varnish start
We have now installed Varnish and it’s up and running. Let’s configure it to cache the pages from our NGINX server.