On Fri, Dec 15, 2006 at 11:58:50AM -0700, Dmitry S. Makovey wrote:
> 
> Somewhat offtopic question, but here it goes:
> 
> does anybody know of a module for apache that will use database to "suck in" 
> part of apache http.conf file? What I need is dynamicaly manage my apache 
> host with as few FS writes as possible. I remember seeing such a thing long 
> time ago. Now I coudn't find it. mod_vhost doesn't cut it since I need full 
> access to pretty muc all apache statements.

I know you can do this with mod_perl.  Basically you can add a <perl>
</perl> block in the config file and populate it with pretty much any
perl command you need that end up outputing apache configuration info. 

I've only used this in it's most basic form, an array of hostnames and a
foreach() that inserts the hostname into a preset block of text that's
printed out.  IE:

<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.



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

Attachment: pgpX95NEqOdW3.pgp
Description: PGP signature

Reply via email to