= install Varnish on CentOS > wget http://superb-west.dl.sourceforge.net/sourceforge/varnish/varnish-2.0.4.tar.gz > tar zxvf varnish-2.0.4.tar.gz > cd varnish-2.0.4 > ./configure > make > make install > cp redhat/varnish.initrc /etc/init.d/varnish > vi /usr/local/etc/varnish/de > sed -i -e 's:exec="/usr/sbin/varnishd":exec="/usr/local/sbin/varnishd":' /etc/init.d/varnis > cp redhat/varnish.sysconfig /etc/sysconfig/varnish > groupadd -r varnish > useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin -c "Varnish http accelerator user" varnish > chkconfig --add varnish > chkconfig --level 345 varnish on > mkdir /var/lib/varnish > vi /etc/sysconfig/varnish DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /usr/local/etc/varnish/default.vcl \ -u varnish -g varnish \ -s file,/var/lib/varnish/varnish_storage.bin,1G" > vi /usr/local/etc/varnish/default.vcl backend wwwA { .host = "192.168.10.2"; .probe = { .url = "/"; .interval = 5s; .timeout = 1 s; .window = 5; .threshold = 3; } } backend wwwB { .host = "192.168.10.3"; .probe = { .url = "/"; .interval = 5s; .timeout = 1 s; .window = 5; .threshold = 3; } } director wwwL round-robin { { .backend = wwwA; } { .backend = wwwB; } } sub vcl_recv { if (req.http.host ~ "^(www.)?test.com$") { set req.backend = wwwL; } }