Contact Support : +64 220 256 070

Aimvm
Blog

How to install and configure varnish for magento store

Posted on: August 15, 2015

The application varnish is used as caching reverse proxy for the websites and application servers. In this topic we will see how it is enabled for magento.

 

1) install Varnish

yum install varnish

2) Install Turpentine

You can use the magentoconnect for installing turpentine.

3) Configuration

Open the file /etc/sysconfig/varnish and add the following entries.

VARNISH_VCL_CONF=/etc/varnish/default.vcl (the VCL file )

VARNISH_LISTEN_ADDRESS=IP address of the server

VARNISH_LISTEN_PORT=80

VARNISH_SECRET_FILE=/etc/varnish/secret (Shared secret file for admin interface)

VARNISH_MIN_THREADS=50  (The minimum number of worker threads to start)

VARNISH_MAX_THREADS=1000 (The Maximum number of worker threads to start)

VARNISH_STORAGE_SIZE=1G

VARNISH_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin (Cache file location)

start varnish on the server

service varnish start

4) We need to change the port of apache as we have configured varnish to listen on port 80. So we are going to use port 8080 for apache.

Open the apache configuration file /etc/httpd/conf/httpd.conf

Change the Listen port to 8080

Check the syntax is ok or not by httpd -t and restart apache

5) Configure Magento store.

Login to Magento admin

Go to System >> configuration >> Varnish options.

Varnish version (auto)

Server list (List of server IPs)

Varnish Authentication Key (Authentication Key for Varnish CLI access)

Config File Location (the Varnish VCL File Should Be Saved)

Custom VCL File Location (Specify where the Varnish VCL customization file Should Be Saved)

To finish up, just click “Save Config” andclick on “Apply Configuration” to save the auto-generated VCL to the default location.

 

 

Search Blog