Varnish, Plone and Apache2

2009-01-21 Thread Charlie Farinella
I have one site running Plone with lighttpd and Varnish that I set up as 
documented here:
http://bitubique.com/content/accelerate-plone-varnish

I have now been asked to set up others substituting Apache2 for lighttpd 
by the developers, but haven't been able to find such detailed 
instructions for Apache2.  I believe I just need to find the Apache 
equivalent for this line from lighttpd.conf:

proxy.server = ( /VirtualHostBase/ = (
( host = 127.0.0.1 , port = 6081 ) )
)

To my understanding something has to listen on port 80, send the request 
to Varnish, which then either serves from the cache or sends the request 
on to the Zope (Plone) port.

If anyone knows offhand or has some experience with this I'd like to hear 
from you.  Is Apache a bad choice for this? 

-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
cfarine...@appropriatesolutions.com
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


still trying to purge

2008-02-20 Thread Charlie Farinella
Hi all,

For the moment I have given up trying to do the http purge thing and am 
trying to find a workaround.  I have the following shell script:

==
#!/bin/sh
host=127.0.0.1
port=6082
cmd=url.purge
param=.*

echo open ${host} ${port}
sleep 1
echo ${cmd} ${param}
sleep 3
echo exit
==

The result of this script is:
==
./clearcache.sh | telnet
telnet Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
105 20  
Too many parameters
Connection closed by foreign host.
==

If I put any other command in the script, it works fine.  If I 
use 'url.purge' as the command, but '^/$' as the parameter, that works 
fine.  Only the '*' or '.*' throws the 'too many parameters' error.  
What is the correct command and format to purge the entire cache?

If anyone has a solution for me I would be very appreciative.  If I 
cannot find an automated way for the web development people to clear 
this cache at will, I'm going to have to try to set up Apache or Squid 
to do the caching and I'd just rather not do that.  :-)

-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: still trying to purge

2008-02-20 Thread Charlie Farinella
On Wednesday 20 February 2008, Charlie Farinella wrote:

In case anyone has the same problem, this will work:

# scriptname
#!/bin/sh
host=127.0.0.1
port=6082
cmd=url.purge
 
echo open ${host} ${port}
sleep 1
echo ${cmd} \*
sleep 3
echo exit

$: ./scriptname | telnet

 Hi all,
 
 For the moment I have given up trying to do the http purge thing and 
am 
 trying to find a workaround.  I have the following shell script:
 
 ==
 #!/bin/sh
 host=127.0.0.1
 port=6082
 cmd=url.purge
 param=.*
 
 echo open ${host} ${port}
 sleep 1
 echo ${cmd} ${param}
 sleep 3
 echo exit
 ==
 
 The result of this script is:
 ==
 ./clearcache.sh | telnet
 telnet Trying 127.0.0.1...
 Connected to localhost.localdomain (127.0.0.1).
 Escape character is '^]'.
 105 20  
 Too many parameters
 Connection closed by foreign host.
 ==
 
 If I put any other command in the script, it works fine.  If I 
 use 'url.purge' as the command, but '^/$' as the parameter, that works 
 fine.  Only the '*' or '.*' throws the 'too many parameters' error.  
 What is the correct command and format to purge the entire cache?
 
 If anyone has a solution for me I would be very appreciative.  If I 
 cannot find an automated way for the web development people to clear 
 this cache at will, I'm going to have to try to set up Apache or Squid 
 to do the caching and I'd just rather not do that.  :-)
 
 -- 
 
 Charles Farinella 
 Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
 [EMAIL PROTECTED]
 voice: 603.924.6079   fax: 603.924.8668
 
 ___
 varnish-misc mailing list
 varnish-misc@projects.linpro.no
 http://projects.linpro.no/mailman/listinfo/varnish-misc
 
 



-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: http purge help

2008-02-19 Thread Charlie Farinella
On Tuesday 19 February 2008, Stig Sandbeck Mathisen wrote:

 You need something in your vcl_recv as well, to match against the
 purge acl, and force it to lookup on an acl match.  It would go
 nicely inside the pipe if not GET or HEAD request from the default
 vcl like this:
 
 sub vcl_recv {
   # [...]
 
   if (req.request != GET  req.request != HEAD) {
 if (req.request == PURGE) {
   if (!client.ip ~ purge) {
 error 405 Not allowed.;
   }
   lookup;
 }
 set req.http.connection = close;
 pipe;
   }
 
   # [...]
 }

My error, we have this section in our vcl file, I forgot to include it.

Perhaps we just misunderstand what should be happening.  What exactly 
will the command 'PURGE /' remove from the cache?  We are trying to 
empty it.

We need to have web developers have the ability to clear the Varnish 
cache.  Currently we are doing it for them by telneting to the Varnish 
management interface and running 'url.purge *'.  We'd like to protect 
them (and us) from that if possible.

I got several responses, thanks to all, but no joy so far.

-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


http purge help

2008-02-18 Thread Charlie Farinella
I am new to Varnish, am trying to implement HTTP purging, and
getting 'not found' responses.  If anyone has a moment to look over
our configuration and make some suggestions or point out errors,
we would be grateful, we are at our wits end.

We have Varnish running behind lighttpd on port 6081 proxying
a Plone installation, so we have lighttpd at port 80, Varnish
at port 6081, and Zope/Plone at port 8080.  All are working as
expected.

uname -n = nec.appropriatesolutions.com

We have our vcl.conf configured like this:
###
acl purge {
localhost;
127.0.0.1;
}

sub vcl_fetch {
# force minimum ttl of 300 seconds
if (obj.ttl  300s) {
set obj.ttl = 300s;
}
}

sub vcl_hit {
if (req.request == PURGE) {
set obj.ttl = 0s;
error 200 Purged;
}
}

sub vcl_miss {
if (req.request == PURGE) {
error 404 What you have requested is not in cache;
}
}
###

We are attempting to send the purge request with a Python script, like 
so:
###
#!/usr/local/bin/python
from httplib import HTTP, HTTPConnection, HTTPResponse

h = HTTPConnection('127.0.0.1:6081')
h.request('PURGE', '/', '', {'Host': 'www.nec.edu'})
resp = h.getresponse()
print resp.read()

status = resp.status
reason = resp.reason
headers = resp.getheaders()

print 'status: ', status
print 'reason: ', reason
print

print headers
print
###

Our varnish log is showing:
###
127.0.0.1 - - [18/Feb/2008:16:14:12 -0500] PURGE http://www.nec.edu/ 
HTTP/1.1 404 451 - -

and the output of the script is:
###
?xml version=1.0 encoding=utf-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html
  head
title404 Not Found/title
  /head
  body
h1Error 404 Not Found/h1
pWhat you have requested is not in cache/p
h3Guru Meditation:/h3
pXID: 891821294/p
addressa 
href=http://www.varnish-cache.org/;Varnish/a/address
  /body
/html

status:  404
reason:  Not Found

[('content-length', '451'), ('x-varnish', '891821294'), ('age', 'nan'), 
('server', 'Varnish'), ('retry-after', '0')
('connection', 'keep-alive'), ('via', '1.1 varnish'), 
('date', 'Mon, 18 Feb 2008 22:08:49 GMT'), ('content-type', 'text/html; 
charset=utf-8')]

-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc