Installing Varnish 3 on CentOS 7

Oddly, there isn’t a lot of information on installing Varnish 3 on CentOS 7. There’s well-written instructions on the official site for CentOS 5/6, but for 7, it seems like you’re stuck with Varnish 4 (from the epel-release repository), especially if you’ve searched around and found forum threads like this one.

I did some digging, though, and it turns out that there actually are packages for CentOS 7 – there just isn’t any documentation on how to install them. I played around a little and found something that worked, though. So far, I haven’t experienced any problems installing via the following:

yum install gcc
 rpm -i
 rpm -i
 rpm -i

You do need to install the packages in this order, as Varnish depends on having gcc and the libraries in place.

You may need to adjust the config and point the pidfile to instead of in /etc/rc.d/init.d/varnish. If you do, remember to run systemctl daemon-reload and kill all active processes before starting the service again.

Keep in mind that Varnish 3 and 4 are radically different in terms of how you write the ACL’s, so if you’re migrating back to 3 from 4, you’ll need to rewrite all your ACL’s.

UPDATE: From the comments, Sergey Postument recommends setting up an independent yum repo with the following configuration:

name=Varnish 3.0 for Enterprise Linux

…and lrkwz recommends installing using

yum –enablerepo=varnish-3.0 –disablerepo=epel install varnish


Leave a Reply

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