--- doc/install/linux/install.pl 2011/05/16 14:00:09 1.13 +++ doc/install/linux/install.pl 2011/05/22 11:56:15 1.14 @@ -72,7 +72,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.13 2011/05/16 14:00:09 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.14 2011/05/22 11:56:15 raeburn Exp $'."\n"; } # @@ -653,11 +653,21 @@ sub chkapache { } } } else { - if (!-e "$instdir/centos-rhes-fedora-sl/httpd.conf") { + my $configfile = 'httpd.conf'; + if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { + if ($1 > 5) { + $configfile = 'new/httpd.conf'; + } + } elsif ($distro =~ /^fedora(\d+)$/) { + if ($1 > 10) { + $conftype = 'new/httpd.conf'; + } + } + if (!-e "$instdir/centos-rhes-fedora-sl/$configfile") { $fixapache = 0; print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; - } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/centos-rhes-fedora-sl/httpd.conf")) { - if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/httpd.conf /etc/httpd/conf/httpd.conf |")) { + } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/centos-rhes-fedora-sl/$configfile")) { + if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/$configfile /etc/httpd/conf/httpd.conf |")) { my $diffres = ; close(PIPE); chomp($diffres); @@ -1255,7 +1265,7 @@ if ($callsub{'apache'}) { } elsif ($distro =~ /^(debian|ubuntu)/) { ©_apache2_debconf($instdir); } else { - ©_httpd_conf($instdir); + ©_httpd_conf($instdir,$distro); } } else { print_and_log(&mt('Skipping configuration of Apache web server.')."\n"); @@ -1689,11 +1699,21 @@ sub get_mysql_version { ########################################################### sub copy_httpd_conf { - my ($instdir) = @_; + my ($instdir,$distro) = @_; + my $configfile = 'httpd.conf'; + if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { + if ($1 > 5) { + $configfile = 'new/httpd.conf'; + } + } elsif ($distro =~ /^fedora(\d+)$/) { + if ($1 > 10) { + $configfile = 'new/httpd.conf'; + } + } print_and_log(&mt('Copying the LON-CAPA [_1] to [_2].',"'httpd.conf'", "'/etc/httpd/conf/httpd.conf'")."\n"); copy "/etc/httpd/conf/httpd.conf","/etc/httpd/conf/httpd.conf.original"; - copy "$instdir/centos-rhes-fedora-sl/httpd.conf","/etc/httpd/conf/httpd.conf"; + copy "$instdir/centos-rhes-fedora-sl/$configfile","/etc/httpd/conf/httpd.conf"; chmod(0444,"/etc/httpd/conf/httpd.conf"); print_and_log("\n"); }