Varnish 3.0.2 and ISPConfig 3.0.4

Posted by Warren Bullock III on Server Fault See other posts from Server Fault or by Warren Bullock III
Published on 2012-04-22T11:41:31Z Indexed on 2013/07/03 11:08 UTC
Read the original article Hit count: 1480

Filed under:
|
|

I followed the tutorial The Perfect Server - Ubuntu 11.10 [ISPConfig 3] here. I'm running an Ubuntu 11.04 (Natty Narwhal) server with 1024 RAM on Rackspace. I've gone through and updated to ISPConfig 3.0.4. Everything has been working great up to now when I decided to try and install Varnish. Initially I did an install of Varnish by issuing:

apt-get update
apt-get upgrade
apt-get install varnish

Apparently the version that was installed was Varnish 2.x so I went back and added the repositories for packages provided by varnish-cache.org

curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" >> /etc/apt/sources.list
apt-get update
apt-get install varnish

This updated my version of Varnish to 3.0.2

I then proceeded to make the following changes:

vim /etc/default/varnish
change DAEMON_OPTS to port 80:
vim /etc/apache2/ports.conf
NameVirtualHost *:8000
Listen 8000
vim /etc/apache2/sites-available/default
<VirtualHost *:8000>
vim /etc/apache2/sites-available/ispconfig.vhost
Listen 8080
NameVirtualHost *:8080
<VirtualHost _default_:8080>

I then proceeded to set my other vhosts to use 8000 (the apache2 port)

so with all this set I reset both Apache2 and Varnish to test. I used Firebug in Firefox 11.0

The output from what I see doesn't seem to indicate that Varnish is working completely correct:

enter image description here

First of all I see: X-Varnish 1644834493 but I've heard that unless you have two timestamps side by side than it's probably not working correctly so for example I was thinking I might see something like:

X-Varnish 1644834493 1644837493

Also if I noticed this in the output which seems to be inconstant:

X-Drupal-Cache MISS

There are times when it will say HIT as well....

So the question here that I have is I think Varnish is partially working, however, why don't I see two timestamps on X-Varnish like I'm thinking I should and does the output of the screenshot I have look correct? If Varnish isn't working can someone tell me what I might being doing wrong?

Thanks in advance.

© Server Fault or respective owner

Related posts about apache2

Related posts about varnish