Considering using Perl Sections

A while back I realized the futility of using a single httpd.conf after
having many errors due to not repeating things correctly in SSL section
and the long length of the file.
I broke it up into a httpd.conf, mod_gzip.conf, a global SSL.conf and a
conf file (and SSL version if needed) for each virtual host.
Right now that is a total of 13 conf files.
I like being able to diff the two versions for each virtual host to look
for errors.

Right now I am using Apache::AuthCookie to protect a variety of
locations, but that is making things complicated again.

At this point, should I break the AuthCookie sections out into confs for
each virtual host using it, learn to use Perl Sections, or something
different? Any suggestions are welcome.

Thanks
Chris Bennett
Chris Bennett [ Fr, 01 Oktober 2010 22:47 ] [ ID #2048325 ]

Re: Considering using Perl Sections

On 10/01/2010 04:47 PM, Chris Bennett wrote:

> At this point, should I break the AuthCookie sections out into confs for
> each virtual host using it, learn to use Perl Sections, or something
> different? Any suggestions are welcome.

We actually like using templated httpd.conf files (we use
HTML::Template, but you can easily use Template Toolkit, Text Template,
etc). This lets us have really simple configs and then keep the stuff
that's different for each client in a separate config file (or even the
database) which is then pulled in and applied to the templated
httpd.conf to generate the final conf.

Works quite well for us.

--
Michael Peters
Plus Three, LP
mpeters [ Fr, 01 Oktober 2010 22:55 ] [ ID #2048326 ]

RE: Considering using Perl Sections

We use a combination of Perl sections and Template Toolkit to generate ou=
r apache configs. The Perl sections are good for run-time setup for thin=
gs like host names (i.e., to name logs per host in our cluster) and the t=
emplating is good for setting up things like multiple proxies that have j=
ust a few differences. In this case, I set up a data structure, and then=
iterate over it to generate the configs for the proxies.

I also set up a utility script to deploy the whole shebang, since you can=
't use the templated configs as actual apche config files. Rendering the=
se templates takes maybe 2 seconds, so I render my dev version against th=
ose that I've deployed to one of our DEV, STAGE, or PROD environments.

Eric

> -----Original Message-----
> From: Chris Bennett [mailto:chris [at] bennettconstruction.biz]
> Sent: Friday, October 01, 2010 4:47 PM
> To: modperl [at] perl.apache.org
> Subject: Considering using Perl Sections
>
> A while back I realized the futility of using a single
> httpd.conf after
> having many errors due to not repeating things correctly in
> SSL section
> and the long length of the file.
> I broke it up into a httpd.conf, mod_gzip.conf, a global
> SSL.conf and a
> conf file (and SSL version if needed) for each virtual host.
> Right now that is a total of 13 conf files.
> I like being able to diff the two versions for each virtual
> host to look
> for errors.
>
> Right now I am using Apache::AuthCookie to protect a variety of
> locations, but that is making things complicated again.
>
> At this point, should I break the AuthCookie sections out
> into confs for
> each virtual host using it, learn to use Perl Sections, or something
> different? Any suggestions are welcome.
>
> Thanks
> Chris Bennett
>
>
>
_______________________________________________

This e-mail may contain information that is confidential, privileged or o=
therwise protected from disclosure. If you are not an intended recipient =
of this e-mail, do not duplicate or redistribute it by any means. Please =
delete it and any attachments and notify the sender that you have receive=
d it in error. Unless specifically indicated, this e-mail is not an offer=
to buy or sell or a solicitation to buy or sell any securities, invest=
ment products or other financial product or service, an official confirma=
tion of any transaction, or an official statement of Barclays. Any views =
or opinions presented are solely those of the author and do not necessari=
ly represent those of Barclays. This e-mail is subject to terms available=
at the following link: www.barcap.com/emaildisclaimer. By messaging wi=
th Barclays you consent to the foregoing. Barclays Capital is the invest=
ment banking division of Barclays Bank PLC, a company registered in Engla=
nd (number 1026167) with its registered office at 1 Churchill Place, Lond=
on, E14 5HP. This email may relate to or be sent from other members of t=
he Barclays Group.
_______________________________________________
eric.berg [ Fr, 01 Oktober 2010 23:52 ] [ ID #2048327 ]
Webserver » gmane.comp.apache.mod-perl » Considering using Perl Sections

Vorheriges Thema: Share Memory Apache2 and ModPerl2
Nächstes Thema: Poll - do you use Apache::Test custom configuration?