On Tue, 27 Jun 2000, Nathan Wiger wrote:
> Hi all-
>
> I've written a module that can parse the Apache httpd.conf config file
> (and in fact any Apache-like config file). It will take a set of
> directive like:
>
> ServerName www.mydomain.com
> UseCanonicalName Off
>
> And parse it case-insensitively, returning a ref to a hash:
>
> my $ac = new Apache::Config;
> my $conf = $ac->readconf($configfile);
> print $conf->{servername}; # = "www.mydomain.com";
> print $conf->{usecanonicalname}; # = 0 (not undef so can test
> # for defined() still)
it would be really cool if this module could support dumping of a parsed
config file into the same format that <Perl> sections understand. and the
other way around, dumping a <Perl> section back into a .conf that Apache
can read without <Perl> sections.
> In any case, I have several questions:
>
> 1. Does a module like this exist anywhere? I saw Doug's
> Apache::httpd_conf, but this only takes care of writing
> a very minimal config file. I looked thru all the
> Apache:: modules but didn't see one.
yeah, Apache::httpd_conf was something that was started and never
finished. i think ken williams is working on something in this area, for
modules to write test config files.
> 2. Is the name Apache::Config a good name for this module?
> It seems like the obvious choice to me, and doesn't
> look like it's taken. I've also played around with
> Apache::ConfigFile and Apache::ReadConf, either of
> which I'm open to as well (or other suggestions?).
i'd go with Apache::ConfigFile.