summaryrefslogtreecommitdiffstats
path: root/web_wizard/scripts
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-09-30 13:46:19 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-09-30 13:46:19 +0000
commita268005176ec34c26aacf9a53f720dbf4e325ae3 (patch)
tree5089b265871647040ea5ee5c63489ac0b8e929cc /web_wizard/scripts
parent2627b72ab32272a435187ce0ccda0141f48a6878 (diff)
downloaddrakwizard-a268005176ec34c26aacf9a53f720dbf4e325ae3.tar
drakwizard-a268005176ec34c26aacf9a53f720dbf4e325ae3.tar.gz
drakwizard-a268005176ec34c26aacf9a53f720dbf4e325ae3.tar.bz2
drakwizard-a268005176ec34c26aacf9a53f720dbf4e325ae3.tar.xz
drakwizard-a268005176ec34c26aacf9a53f720dbf4e325ae3.zip
added doc root field
Diffstat (limited to 'web_wizard/scripts')
-rw-r--r--web_wizard/scripts/Webconf.pm36
1 files changed, 32 insertions, 4 deletions
diff --git a/web_wizard/scripts/Webconf.pm b/web_wizard/scripts/Webconf.pm
index 06a17fa5..cf9d9b55 100644
--- a/web_wizard/scripts/Webconf.pm
+++ b/web_wizard/scripts/Webconf.pm
@@ -15,6 +15,36 @@ sub check {
0;
}
+my $file = "/etc/httpd/conf/commonhttpd.conf";
+my $root;
+
+if (-f $file) {
+ open(FH, "< $file") or die "$! ($file)";
+ while (<FH>) {
+ if (/^\s*\#?\s*DocumentRoot\s+(.*)/) {
+ close(FH);
+ $root = "$1";
+ last;
+ }
+ }
+ close(FH);
+}
+
+sub get_docroot {
+ $root;
+}
+
+sub check_dir {
+ -d ($ENV{wiz_dir}) and return 10;
+ 1;
+}
+
+sub chg_docroot {
+ substInFile {
+ s|(^\s*\#?\s*DocumentRoot\s*).*|$1$ENV{wiz_dir}|;
+ } "/etc/httpd/conf/commonhttpd.conf";
+}
+
sub do_it {
my $file = "/etc/httpd/conf/commonhttpd.conf";
my $that = "localhost";
@@ -28,13 +58,11 @@ sub do_it {
}
cp_af($file, $file.".orig");
substInFile {
- if( m /^\s*<Directory \/home/s...m/^\s*<\/Directory>/s ) {
- { s /^\s*Allow .*$/ Allow from $that\n/s;}
- ;}
- if( m /^\s*<Directory \/var\/www/s...m/^\s*<\/Directory>/s ) {
+ if( m /^\s*<Directory.*>/s...m/^\s*<\/Directory>/s ) {
{ s /^\s*Allow .*$/ Allow from $that\n/s;}
;}
} $file;
+# chg_docroot();
system("/etc/rc.d/init.d/httpd restart");
10;
}