Install Varnish 3 on CentOS 6 or Redhat#

For RHEL 6 and compatible distributions, use

rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm
yum install varnish
varnish -v

config #

  • vi /etc/varnish/default.vcl

Change IP to listen on specific IP and update VCL as required


backend default {
  .host = "xx.xx.xx.xx";
  .port = "80";
}

sub vcl_recv{

if (!req.request == "GET") {
                return(pass);
        }
else
{

return(lookup);
}


}
sub vcl_fetch{
set beresp.ttl = 1w;
return(deliver);
}

  • change port on varnish to listen to 80 for specific IP
  • Change port on apache to listen to 8080

https://www.varnish-cache.org/docs/3.0/tutorial/statistics.html

Varnish config file#

/etc/sysconfig/varnish
  • Restart
service varnish restart
  • Log
/var/log/varnish

Prime the cache#

  • Prime cache by running a log for a few days
varnishlog -D -a -w /var/log/varnish.log
  • Then load in log file
varnishreplay -r /var/log/varnish.log
varnishtop -i txurl

Compilation error on a VCL, run from command line to view the error#

varnishd -f /etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000  -a 0.0.0.0:8080 -d

Back to Linux

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-15) was last changed on 24-May-2017 15:30 by Hyve Support
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X
    

All Pages

Page views: 7764

Private Tomcat

Linux

MySQL

Email

SQL Server

ASP

JSP

C#

Web Mail

Windows Plesk

Linux Plesk

PHP

Gaming

ASP.NET

Persits ASPUpload

Wiki Help

Referring Pages:
...nobody

JSPWiki v2.8.1