summaryrefslogtreecommitdiffstats
path: root/web_wizard/Apache.pm
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2003-09-15 11:10:22 +0000
committerFlorent Villard <warly@mandriva.com>2003-09-15 11:10:22 +0000
commit724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7 (patch)
tree2e796bb5e0cb5fb582b6f48563696337b6bea18d /web_wizard/Apache.pm
parent5cbe71386657f4f045cbd59137f5e1d702a93292 (diff)
downloaddrakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar
drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.gz
drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.bz2
drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.tar.xz
drakwizard-724f7a8d02d6cd48b108a8f2cfbb98feeecae2a7.zip
fix apache
fix dns_client adding a \n at the end of the line of the configuration file fix squid fix inn fix ftp fix samba add a init function in drakwizard.pl for case such as apache which need to initialize some parameters separate region/country in ntp wizard
Diffstat (limited to 'web_wizard/Apache.pm')
-rwxr-xr-xweb_wizard/Apache.pm43
1 files changed, 26 insertions, 17 deletions
diff --git a/web_wizard/Apache.pm b/web_wizard/Apache.pm
index 91095ea2..05b20ea2 100755
--- a/web_wizard/Apache.pm
+++ b/web_wizard/Apache.pm
@@ -41,8 +41,24 @@ my $o = {
user_dir => '',
shared_dir => ''
},
- needed_rpm => [ ( $config->{ver} == 2 ? 'apache2' : 'apache') ],
- defaultimage => "$ENV{__WIZARD_HOME__}web_wizard/images/apache.png"
+ needed_rpm => '',
+ defaultimage => "$ENV{__WIZ_HOME__}web_wizard/images/apache.png",
+ init => sub {
+ if (-f $file) {
+ open my $FH, $file or die "$! ($file)";
+ while (<$FH>) {
+ if (/^\s*\#?\s*DocumentRoot\s+(.*)/) {
+ close($FH);
+ $root = $1;
+ last;
+ }
+ }
+ close($FH);
+ } else {
+ return (0, N("%s does not exist.", $file))
+ }
+}
+
};
$o->{pages} = {
@@ -63,7 +79,7 @@ $o->{pages} = {
dhcp_warning => {
name => N('Warning.'),
data => [ { label => N('You are in dhcp, server may not work with your configuration.') } ],
- next => 'summary'
+ next => 'config'
},
ask_mod => {
name => N('Modules :') . "\n\n" . N('* User module : allows users to have a directory in their home directories available on your http server via http://www.yourserver.com/~user, you will be asked for the name of this directory afterward.'),
@@ -131,20 +147,13 @@ available on your http server via http://www.yourserver.com/~user.'), type => 'b
sub new {
my ($class, $conf) = @_;
$config = $conf;
- $file = $config->{ver} == 2 ? "/etc/httpd/conf/httpd2.conf" : "/etc/httpd/conf/httpd.conf";
- if (-f $file) {
- open my $FH, $file or die "$! ($file)";
- while (<$FH>) {
- if (/^\s*\#?\s*DocumentRoot\s+(.*)/) {
- close($FH);
- $root = $1;
- last;
- }
- }
- close($FH);
+ if ($config->{ver} == 2) {
+ $file = "/etc/httpd/conf/httpd2.conf";
+ $o->{needed_rpm} = [ 'apache2' ]
} else {
- return (0, N("%s does not exist.", $file))
- }
+ $file = "/etc/httpd/conf/httpd.conf";
+ $o->{needed_rpm} = [ 'apache' ]
+ }
bless {
o => $o,
}, $class;
@@ -215,7 +224,7 @@ sub do_it {
$that = "all";
}
elsif ($o->{var}{web_internal} eq "1") {
- ($that) = $o->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
+ ($that) = $wiz->{net}->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
$that .= " 127.0.0.1";
}
cp_af($file, $file.".orig");