Vanish is a proxy and cache server which is designed to improve websites performance. Vanish works great for busy and dynamic websites by redirecting dynamic calls to static cached pages thus reducing the number new requests that can be served.

For example, a website built using WordPress will serve many requests each time a visitor comes to your site. If the page the visitor is on has images, text, forms and other web content, each visit will result in many dynamic requests to the database server, web server, PHP and other services.

When using Vanish proxy server, the first request will generate these many dynamic calls to the database, web server and other services. Then these requests will be stored in a static cache repository for later to serve subsequent requests.

Each new request to the same web page will return the static version of the page as long it’s still valid in the cache, thus reducing page loads. That’s how Vanish works and this brief tutorial is going to show you how to install it in CentOS 7.

To get stated with installing Vanish, you must first enable the EPEL community repository since Vanish isn’t available from the default sets of repositories which come installed with CentOS 7.

Run the commands below to enable the EPEL repository on CentOS 7

rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm

Then run the commands below to update your system ensuring that the latest packages are updated for each installed repository on your system.

sudo yum -y update

Finally, run the commands below to install Vanish.

sudo yum -y install varnish

 

After installing Vanish, you can start it by running the commands below.

sudo systemctl start varnish

Another thing to do also is to enable Vanish to automatically start up everytime your system reboots or is restarted. This will ensure that your services are always up.

sudo systemctl enable varnish

To check the status, run the commands below.

sudo systemctl status varnish

Vanish default configuration file is at

/etc/varnish/default.vcl

 

Now, Vanish is a great proxy server to install along with your web servers, It works with Apache2, Nginx and other web servers. Using it will definitely improve your page loading time for your blogs. Configuring it might be a bit challenging for new webmasters, but over time you’ll get to understand and appreciate it.

There are many tutorials online that will show you how to use Vanish with Apache2 or Nginx to improve your websites, follow these tutorials and try to apply them on your own sites.

My next post on Vanish will be how to configure along with your webservers to gain improvements.

An example configuration for Vanish can be found at

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

Check it out and build your configuration from it.

If you’re having hard time starting or restarting Vanish, you may have to disable SELinux. Open SELinux file and disable it.

sudo vi /etc/sysconfig/selinux

Enjoy!