/etc/yum.repos.d/varnish.repo
[varnishcache_varnish41]
name=varnishcache_varnish41
baseurl=https://packagecloud.io/varnishcache/varnish41/el/6/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
OK, ready then
yum clean all
yum install varnish
Check the version:
…
# /usr/sbin/varnishd -V
varnishd (varnish-4.1.8 revision d266ac5c6)
varnishadm ban
When cleaning the cache on varnish 3.0 there is a way to only ban the specific host.
The command is:
varnishadm -T localhost:1234 ban req.http.host ~ “site.com” && req.url ~ …
How to get varnish client.ip behind ELB
How to get varnish client.ip behind ELB
I needed to filter access by IP using varnish acl, but when your varnish is behind a Amazon ELB Load Balancer, by default …
check_varnish_uptime
Simple script to check if the varnish daemon has been restarted latelly
Here is the code:
#!/bin/bash #Get current varnish uptime #Version 1.0 #By Felipe Ferreira Set 2013 #Variables CRIT=900…
check_backend.sh
Another bash script to monitor if there were any failed connections to the backend’s.
It is a simple aproach using the command:
varnishstat -1 -f backend_fail
Then it puts the …
varnish check_hitratio
We need to know if varnish is caching hit ratio is as it should.
So I wrote this simple bash plugin for nagios.
./check_hitratio.sh 96 90
OK – 98.67% hit_ratio|hit_ratio=98.67…
Script to purge varnish cache
There is a easy way to allow developers to stop bugging us the system adminsitror, “clean the cache”.
Just setup this php page on a apache server and they can …