Egor Shipovalov wrote: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.
Aha... well, after it didn't work right away, and add_config _did_ seem to work, I just didn't look any further. A wrapper routine is easily written.
In any case, I have now resorted to changing the actual config file before actually starting with a wrapper around apachectl. Too many odd things were happening and I don't have the time to look at them now... ;-(
Though I agree that requiring [EMAIL PROTECTED] and not allowing $lines ala mp1's httpd_conf is silly, and we should support both.
Indeed... ;-)
Liz
-- 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