On Fri, Dec 15, 2006 at 02:43:49PM -0700, Dmitry S. Makovey wrote:
> On Friday 15 December 2006 13:49, Alan wrote:
> > <Perl>
> > #!perl
> > foreach my $host ( qw( foo bar baz) ) {
> >
> >    push @PerlConfig, <<EOF;
> > <VirtualHost xx.xx.169.216:80>
> >       DocumentRoot   /home/httpd/vhosts/${host}.com/
> >       ServerName     ${host}.com
> >       ServerAlias    www.${host}.com
> >       DirectoryIndex index.html index.shtml index.htm index.php
> >       CustomLog      /usr/local/apache/logs/${host}-access.log common
> >       ErrorLog       /usr/local/apache/logs/${host}-error.log
> >         [...] you get the picture
> >       ScriptAlias /cgi-bin/ "/home/httpd/vhosts/${host}.com/cgi-bin/"
> > </VirtualHost>
> >
> > EOF
> > }
> > __END__
> > </Perl>
> >
> > Mod_Perl docs have more info, but that's the gist of it.
> 
> that's pretty close, thanks. My only worry is how do I hook up database into 
> it so that I don't initiate connection with MySQL per-request, but rather 
> have some pooling or otherwise reuse same connection since there are not 
> updates - only selects.

Good question, however, I'd throw a 'use DBI;' and your select statments
in and see what happens.  Are you looking to have new vhosts appear as
you add them into the DB behind the scenes?  I'm not sure if this will
work truely dynamically or only when apache first reads the config file.
I did my setup simply to save the maintenance on adding 40+ vhost blocks
:)



-- 
Alan <[EMAIL PROTECTED]> - http://arcterex.net
--------------------------------------------------------------------
"Backups are for people who don't pray."                 -- big Mike

Attachment: pgpY791hF0oaM.pgp
Description: PGP signature

Reply via email to