Subject: | Bug in Config::General parsing Apache configuration |
Date: | Wed, 09 Sep 2009 12:50:50 -0700 |
To: | bug-Config-General [...] rt.cpan.org |
From: | Eric Fox <efox [...] einsteinindustries.com> |
EDIT:
The same problem exists when there is a "<Directory />" directive within a virtual host block.
Quoting the slash avoids the error, but "SlashIsDirectory" does not seem to be working as expected.
Config::General 2.44
Perl v5.10.0
Linux 2.6.29.6
Config::General: EndBlock "</VirtualHost>" has no StartBlock statement
(level: 1, chunk 5117)!
When parsing an Apache configuration file, a <Directory> directive
within a <VirtualHost ...> directive causes the above error IF the
<Directory> directive includes a path with a trailing slash. Removing
the trailing slash from the path avoids the error.
example:
tie my %config, 'Tie::DxHash';
my $cg = Config::General->new(
-ConfigFile => $vhosts,
-ApacheCompatible => 1,
-Tie => 'Tie::DxHash'
);
%config = $cg->getall;
----
<VirtualHost *:80>
DocumentRoot /www/example.com/public_html/
ServerName www.example.com
<Directory /www/example.com/public_html/>
Options +ExecCGI
</Directory>
</VirtualHost>
Thanks,
Eric
--
---------------------------------------------
Eric Fox
System Administrator
---------------------------------------------
IT Department
Einstein Industries, Inc.
www.einsteinindustries.com
Phone: (858) 362 4957
Fax: (858) 452 8672
Email: efox@einsteinindustries.com
---------------------------------------------