NAME
Apache::Admin::Config - A common module for manipulate Apache configurations files
SYNOPSIS
use Apache::Admin::Config;
my $apache_conf = new Apache::Admin::Config ("/path/to/config_file.conf")
|| die $Apache::Admin::Config::ERROR;
# parsing contents
my @directives = @{ $apache_conf->directive() || die $apache_conf->error };
my @sections = @{ $apache_conf->section() || die $apache_conf->error };
my @file_sections = @{ $apache_conf->section('file') || die $apache_conf->error };
# parsing file section contents
my @file_directives = @{ $apache_conf->section(file=>$file_sections[0])->directive };
my @file_sections = @{ $apache_conf->section(file=>$file_sections[0])->section };
# adding directive/section
$apache_conf->add_directive(Options=>'+Indexes');
$apache_conf->section(File=>'/some/file')->add_directive(Allow=>'from all');
$apache_conf->add_section(File=>'/some/file');
$apache_conf->section(VirtualHost=>'some.host')->add_section(File=>'/some/file');
# change directive value
$apache_conf->directive(Options=>'+Indexes')->value('+Indexes -FollowSymlinks');
$apache_conf->section(File=>'/some/file')->directive(Allow=>'from all')->value('from 127.0.0.1');
$apache_conf->section(File=>'/some/file')->value('/some/other/file');
$apache_conf->section(VirtualHost=>'some.host')->section(File=>'/some/file')->value('/some/other/file');
# delete directive (the last one if more than one identicales)
$apache_conf->directive(Options=>'+Indexes')->delete;
$apache_conf->section(File=>'/some/file')->directive(Allow=>'from all')->delete;
$apache_conf->section(File=>'/some/file')->delete;
$apache_conf->section(VirtualHost=>'some.host')->section(File=>'/some/file')->delete;
# save changes
$apache_conf->save;
$apache_conf->save('/path/to/another/file.conf');
DESCRIPTION
under construction
METHODES
new
under construction
save
under construction
delete
under construction
value
under construction
add_section
under construction
section
@sections_name = $obj->section;
@sections_entrys = $obj->section(SectionName);
$section_object = $obj->section(SectionName=>'value');
arguments:
name : the name of section, it's "File" in section <File "/path/to/file"></File</File> value : the value of the section
add_directive
under construction
directive
under construction
error
under construction
AUTHOR
Olivier Poitrey <rs@rhapsodyk.net>
LICENCE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc. :
59 Temple Place, Suite 330, Boston, MA 02111-1307
COPYRIGHT
Copyright (C) 2001 - Olivier Poitrey
HISTORY
$Log: Config.pm,v $ Revision 1.14 2001/08/18 13:38:25 rs fix major bug, if config file wasn't exist, module won't work
Revision 1.13 2001/08/18 12:50:14 rs value method wasn't take the appropriate value for change it
Revision 1.12 2001/08/18 12:46:15 rs $root value was not defined !
Revision 1.11 2001/08/18 12:39:35 rs migrate to 0.05
Revision 1.10 2001/08/18 12:39:15 rs bug fix in value method, $master wasn't defined, cause method to not work at all
Revision 1.9 2001/08/16 23:41:59 rs fix bug in directive method : directive foo doesn't exists @{$conf->directive("foo")}; $conf->add_directive(foo=>'bar'); Modification of non-creatable array value attempted, subscript -1 at ... line 358.
Revision 1.8 2001/08/16 23:07:04 rs fix a bug in directive methode.
Revision 1.7 2001/08/15 23:48:33 rs Fix a major bug that cause "syntaxe error" on directives that haven't values like "clearmodulelist"
Revision 1.6 2001/08/14 09:49:07 rs adding some pod sections