> 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
);
}
Best regards,
Egor Shipovalov.
--
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