Monitoring Varnish Cache: a Really Simple Varnish Panel

Monitoring Varnish Cache: a Really Simple Varnish Panel

I was looking for a Varnish Cache GUI in order to test, monitor and adjust my Varnish configuration.
Maybe I did not look hard enough but I found none.

Really Simple Varnish Panel on Nexus 7Of course there is the Varnish Administration Console (VAC) but you need an Enterprise subscription to get that (starting at 9900€/year) and you may as well use a sledgehammer to crack a nut.

So I decided to write one: “Really Simple Varnish Panel”.

This app uses cool new stuff such as jQuery and TwitterBootstrap but also very ugly old ones such as CGI.
Why?
Because it was the easiest way!

NB: Do not use on production server. Use for testing purpose only.

Features

  • Display real-time varnishstat with HIT/(HIT+MISS) ratio
  • Display real-time varnishlog
  • Ban every URL from cache
  • Restart Varnish cache

That’s it. Nothing more. But it was all I needed.
Really Simple Varnish Panel
Really Simple Varnish Panel

Get the source code

Get Really Simple Varnish Panel source code at GitHub.

Installing rsvp

  • Obviously, you need a Vanish cache server (version 3) up and running.
  • You need Apache running on the same server, different ip port, let’s say 81, but anyone will do.
  • You need Apache to be able to connect to varnishadm, so copy /etc/varnish/secret to /etc/varnish/secret.www-data and chown it to www-data:www-data.
  • I strongly suggest that you protect your server with some authentification (.htpasswd with Basic AuthType should be enough).
  • Copy rsvp directory to /var/, www-data should have write access to /var/rsvp/www/logs/ directory.
  • You need also to know how to create an Apache VHOST. That’s about it!


<VirtualHost *:81>
  ServerAdmin admin@localhost
    DocumentRoot /var/rsvp/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        AuthType Basic
        AuthName "Really Simple Varnish Panel"
        AuthType Basic
        AuthUserFile /var/rsvp/.htpasswd
        Require valid-user
    </Directory>
    <Directory /var/rsvp/www>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /var/rsvp/cgi-bin/
    <Directory "/var/rsvp/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/rsvp-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/rsvp-access.log combined

</VirtualHost>


Tags

Like this Article? Share it!

About the Author

Author Gravatar
Benjamin Bellamy

Paris, Beirut, NYC & Agen // e-commerce, social media, open-source & geek // follow me on twitter: @benjaminbellamy.

Related Posts

Comments are closed.