httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] recovering a .conf file
Date Wed, 26 Nov 2008 20:50:16 GMT
André Warnier wrote:
> Brian Munroe wrote:
>> On Wed, Nov 26, 2008 at 8:21 AM, André Warnier <> wrote:
>>> John Clement wrote:
> I was serious when I asked about mod_perl.
> Have a look here :
> and particularly at
>  use Data::Dumper;
>   print Dumper $tree->as_hash;
> So, is mod_perl installed as part of your Apache, or not ?
> If it is installed, then it might be as simple as creating a small perl 
> script, copying it into your cgi-bin directory, and run it.
> Maybe. I haven't tested it. But it would be worth a try.
Replying to myself now.
Here is the perl script, could not resist trying it out.

#!/usr/bin/perl -w
use strict;
use Apache2::Directive ();
use Data::Dumper;
$Data::Dumper::Indent = 1;
my $tree = Apache2::Directive::conftree();
     print "Content-type: text/plain\n\n";
     print Dumper $tree->as_hash;
     exit 0;

It prints absolutely the full configuration, even directives I did not 
even know I had (probably the defaults assumed by Apache for some things).
Only works if you have mod_perl though.
This being said, since I do have mod_perl configured, I will leave this 
script installed, just in case I ever encounter the same problem as the 
OP here.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message