- Change the Apache listening port;
- Locate the correct Varnish repo;
- Install the EPEL yum repository;
- Install varnish;
- Configure the varnish port and functionality;
- Start and monitor the service.
Change the Apache Listening Port

Locating the Correct Varnish Repo
https://packagecloud.io/varnishcache
cat /etc/redhat-release

Installing Varnish
rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release/varnish-release-3.0-1.el5.centos.noarch.rpm
yum install varnish

Configuring Varnish
/etc/varnish/varnish.params

/etc/varnish/default.vcl
backend default { .host = "87.76.28.180"; .port = "8080"; }
sub vcl_recv { if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") { return(lookup); } } sub vcl_fetch { if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") { unset beresp.http.set-cookie; } }
chkconfig varnish on service varnish start

varnishstat
0 Comments