install varnish centos redhat

To install varnish on centos or redhat


#!/bin/bash
echo "Adding Varnish Repository and installing varnish"
rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm > /dev/null 2>&1
yum -q -y install varnish
echo "Varnish installed."
chkconfig varnish on

echo "Fetching standard Varnish config from Cloud Files..."
sed -i 's/VARNISH_LISTEN_PORT=6081/VARNISH_LISTEN_PORT=80/g' /etc/sysconfig/varnish
wget --quiet -P /etc/varnish/ http://c460059.r59.cf2.rackcdn.com/cent_default3.vcl
mv -f /etc/varnish/default.vcl /etc/varnish/default.vcl.orig
mv -f /etc/varnish/cent_default3.vcl /etc/varnish/default.vcl
echo "Varnish Configured."  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.