Install and configure Varnish 4 and Munin plugin for WordPress on cPanel/WHM CentOS 6 servers

So you have a VPS with cPanel/WHM (11.48) and want to run Varnish 4 reverse proxy to accelerate the server for your WordPress installations while monitoring Varnish 4 with Munin.

1. Install Varnish 4 – just follow these instructions

2. Configure Varnish listening port to 80 by editing /etc/sysconfig/varnish file. In same file decide where to store the cache (on disk – default option, or on memory).

3. Configure vcl files by following these instructions: Please note that you should use the backend server public IP and a chosen port such as 8080 in the <pre>backend default {}</pre> section. In default.vcl file just delete the websites filter (his wife’s websites) or modify them as necessary.

4. Tweak settings for Apache in WHM and set non-SSL port to 8080 (or another port you chosen at step 3)

5. Restart Apache and start varnish with

. If the varnish service does not start you need to debug your vcl files, most probably you introduced a typo. At this time you should be able to access all websites via varnish proxy. You can check it by accessing the WordPress websites and inspecting elements headers, you should be able to see Age and X-Varnish headers. Please do not login into backend of WordPress, the logged in users are not receiving cached files and Age header will always be 0.

6. Download varnish4_ plugin for Munin from here:

7. Edit the plugin file and change first line with:

8. Upload the file to munin plugins folder at /usr/local/cpanel/3rdparty/share/munin/plugins and make it executable (change permissions to 755)

9. Create symlinks for all necessary aspects with these commands:

10. Edit /etc/munin/plugin-conf.d/cpanel.conf file and add this section:

11. restart munin by

12. After few minutes varnish graphs will appear in WHM under Munin plugin.

Tags: , , ,


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.

Recommended Articles