How to Install Varnish on Fedora 21

Reading Time: < 1 minute
Note:
Please note that this article is considered legacy documentation because Fedora 21 has reached its end-of-life support.

Varnish is a proxy and cache, or HTTP accelerator, designed to improve performance for busy, dynamic websites. By redirecting traffic to static pages whenever possible, varnish reduces the number of dynamic page calls, thus reducing load.

Pre-Flight Check
  • These instructions are intended specifically for installing the Varnish on Fedora 21.
  • I’ll be working from a Liquid Web Self Managed Fedora 21 server with HTTPD and PHP already installed, configured, and running, and I’ll be logged in as root.

Step 1: Install Varnish

First, you’ll follow a simple best practice: ensuring the list of available packages is up to date before installing anything new.

yum -y update

At this point, installing Varnish is as simple as running just one command:

yum -y install varnish

Step 2: Start Varnish

To configure varnish to start at boot, run the following command:

systemctl enable varnish

To start varnish, run the following command as root:

systemctl start varnish

To check the status of varnish, run the following command as root:

systemctl status varnish

Check the version of Varnish that is running:

varnishd -V

Varnish is configured to listen on port 6081 by default. It expects your web server to be local, or on the same server and listening on port 8080.

Step 3: Configuration File Locations

A basic and default configuration file can be found at:

/etc/varnish/default.vcl

An example configuration can be found in:

/usr/share/doc/varnish/example.vcl

For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor

To view or edit example.vcl:

vim /usr/share/doc/varnish/example.vcl

About the Author: J. Mays

Have Some Questions?

Our Sales and Support teams are available 24 hours by phone or e-mail to assist.

1.800.580.4985
1.517.322.0434

Latest Articles

What is an Intrusion Prevention System (IPS)?

Read Article

Premium Business Email Pricing FAQ

Read Article

What is the Fortran Programming Language?

Read Article

Microsoft Exchange Server Security Update

Read Article

How to Monitor Your Server in WHM

Read Article