Can I add vhosts with $s->add_config? Something like:
$s->add_config( "VirtualHost foo.com:80" ); $s->add_config( "VirtualHost bar.com:80" );
and then do the loop with $s->next? Or am I now stretching the API beyond to what was intended?
I once was in your position and found httpd_conf a lot more convenient than add_config. Just feed it the text you would normally write in httpd.conf:
foreach my $vhost (@vhosts) {
$s->httpd_conf(<<EOT
<VirtualHost $vhost{name}:80>
ErrorLog /var/log/httpd/$vhost{name}/error.log
...usual config stuff here... </VirtualHost>
EOT
);
}
$s->httpd_conf is not a mp2 API, you can use it only with Apache::compat.
Though I agree that requiring [EMAIL PROTECTED] and not allowing $lines ala mp1's httpd_conf is silly, and we should support both.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html