/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-01 / Multi HeadRequire "Host:" directives in 2.0

[ << ] [ >> ]

[ Pound, DNS lookup, and webalizer question / ... ] [ Problem with Pound 2.0b6 / "Sergio ... ]

Multi HeadRequire "Host:" directives in 2.0
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2006-01-26 15:05:45 [ FULL ]
So far 2.0b6 is proving to be much better than the earlier beta versions
for us and as I've mentioned previously the configuration syntax makes
my job much easier.

I'm now in the process of moving approx. ~20 live sites from our
establish Pound 1.9 setup to another cluster running 2.0b6. The config
syntax in 2.0 for these systems would be something along the lines of:

Service
	HeadRequire     "Host:.*website1.ncl.ac.uk.*"
	URL             "/static_images/.*"
	BackEnd
		Address         apachenodeA.ncl.ac.uk
		Port            80
	End
End
Service
	HeadRequire     "Host:.*website1.ncl.ac.uk.*"
	BackEnd
		Address         zopenodeA.ncl.ac.uk
		Port            8001
	End
End
      
As all 20 of these sites I am transferring over reference the same
apache static URL, I was wondering if it is possible to specify multiple
HeadRequire directives in one Service stanza something like:

Service
	HeadRequire
"Host:.*website1.ncl.ac.uk.*|Host:.*website2.ncl.ac.uk.*"
	URL             "/static_images/.*"
	BackEnd
		Address         apachenodeA.ncl.ac.uk
		Port            80
	End
End

... so that only the Zope side of the services would require listing for
each site? (ie 21 service directives rather than 40!) 

 John Snowdon - IT Support Specialist
-==========================================-
 School of Medical Education Development 
 Faculty of Medical Sciences Computing
 University of Newcastle

 Email : j.p.snowdon(at)ncl.ac.uk

RE: [Pound Mailing List] Multi HeadRequire "Host:" directives in 2.0
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2006-01-26 15:59:02 [ FULL ]
Ok, changed the syntax a little after looking at a few more of my URL
directives:

Service
	
HeadRequire"Host:.*(website1.ncl.ac.uk|website2.ncl.ac.uk|web-site*.ncl.
ac.uk).*"
	URL             "/static_images/.*"
	BackEnd
		Address         apachenodeA.ncl.ac.uk
		Port            80
	End
End

Hopefully this should match all requests to...

website1.ncl.ac.uk/static_images/
website2.ncl.ac.uk/static_images/
web-site.ncl.ac.uk/static_images/
...
web-siteXYZ.ncl.ac.uk/static_images/

I'll give it a try!

-John
 [...]

RE: [Pound Mailing List] Multi HeadRequire "Host:" directives in 2.0
Robert Segall <roseg(at)apsis.ch>
2006-01-26 16:29:18 [ FULL ]
On Thu, 2006-01-26 at 14:59 +0000, John Snowdon wrote:[...]

You may want the shorter version:

HeadRequire "Host:.*(website[12]|web-site).ncl.ac.uk.*"
[...]

Careful: it means you only process requests for /static_images/.* and
everything else is ignored! You probably want some additional Service
for other requests.
[...][...]

RE: [Pound Mailing List] Multi HeadRequire "Host:" directives in 2.0
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2006-01-26 16:37:44 [ FULL ]
Sorry, yes, I meant to imply that this stanza matches the requests to
pass to Apache (there is only one URL we need to capture in that
situation), but I would still have the other ~20 service stanzas for the
individual zope servers.

Cheers Robert, that improves my HeadRequire expression somewhat ;-)

-John

 John Snowdon - IT Support Specialist
-==========================================-
 School of Medical Education Development 
 Faculty of Medical Sciences Computing
 University of Newcastle

 Email : j.p.snowdon(at)ncl.ac.uk

[...][...][...]
ite*.ncl.[...][...][...][...]
84345000/1138289358000

MailBoxer