--- doc/install/linux/install.pl 2019/10/07 22:28:02 1.58 +++ doc/install/linux/install.pl 2019/10/30 03:42:05 1.59 @@ -77,7 +77,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.58 2019/10/07 22:28:02 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.59 2019/10/30 03:42:05 raeburn Exp $'."\n"; } # @@ -748,6 +748,9 @@ sub chkconfig { if ($version >= 19) { $daemon{'mysql'} = 'mariadb'; } + if ($version >= 26) { + $daemon{'ntp'} = 'chronyd'; + } } elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) { my $version = $1; if ($version >= 7) { @@ -1042,6 +1045,7 @@ sub chkapache { } } else { my $configfile = 'httpd.conf'; + my $mpmfile = 'mpm.conf'; if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) { if ($1 >= 7) { $configfile = 'apache2.4/httpd.conf'; @@ -1050,7 +1054,7 @@ sub chkapache { } } elsif ($distro =~ /^fedora(\d+)$/) { if ($1 > 17) { - $configfile = 'apache2.4/httpd.conf'; + $configfile = 'apache2.4/httpd.conf'; } elsif ($1 > 10) { $configfile = 'new/httpd.conf'; } @@ -1068,6 +1072,20 @@ sub chkapache { } } } + if (-e "/etc/httpd/conf.modules.d/00-mpm.conf") { + if (!-e "$instdir/centos-rhes-fedora-sl/$mpmfile") { + print &mt('Warning: No LON-CAPA Apache MPM configuration file found for installation check.')."\n"; + } elsif ((-e "/etc/httpd/conf.modules.d/00-mpm.conf") && (-e "$instdir/centos-rhes-fedora-sl/$mpmfile")) { + if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/$mpmfile /etc/httpd/conf.modules.d/00-mpm.conf |")) { + my $diffres = ; + close(PIPE); + chomp($diffres); + if ($diffres) { + $fixapache = 1; + } + } + } + } } return $fixapache; } @@ -1986,6 +2004,7 @@ if ($callsub{'apache'}) { ©_apache2_debconf($instdir,$distro,$hostname); } else { ©_httpd_conf($instdir,$distro,$hostname); + ©_mpm_conf($instdir,$distro); } } else { print_and_log(&mt('Skipping configuration of Apache web server.')."\n"); @@ -2577,6 +2596,50 @@ sub copy_httpd_conf { print_and_log("\n"); } +########################################################### +## +## RHEL/CentOS/Fedora/Scientific Linux +## Copy LON-CAPA mpm.conf to /etc/httpd/conf.modules.d/00-mpm.conf +## +## The LON-CAPA mpm.conf enables the prefork MPM module in +## Apache. This is also the default for RHEL/CentOS/Oracle +## Linux 7and earlier, and Fedora 26 and earlier. For more +## recent versions of those distros, the event MPM is enabled +## by default. After ©_mpm_conf() is run, the prefork MPM +## module will be enabled instead of the event MPM module. +## +########################################################### + +sub copy_mpm_conf { + my ($instdir,$distro) = @_; + my $mpmfile = 'mpm.conf'; + if ((-e "/etc/httpd/conf.modules.d/00-mpm.conf") && + (-e "$instdir/centos-rhes-fedora-sl/$mpmfile")) { + print_and_log(&mt('Copying the LON-CAPA [_1] to [_2].',"'mpm.conf'", + "'/etc/httpd/conf.modules.d/00-mpm.conf'")."\n"); + copy "$instdir/centos-rhes-fedora-sl/$mpmfile","/etc/httpd/conf.modules.d/00-mpm.conf"; + chmod(0644,"/etc/httpd/conf.modules.d/00-mpm.conf"); + print_and_log("\n"); + } else { + my $logfail; + if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) { + if ($1 > 7) { + $logfail = 1; + } + } elsif ($distro =~ /^fedora(\d+)$/) { + if ($1 > 26) { + $logfail = 1; + } + } + if ($logfail) { + print_and_log(&mt('Warning: copying the LON-CAPA [_1] failed because [_2] and/or [_3] are missing.', + $mpmfile,"'$instdir/centos-rhes-fedora-sl/$mpmfile'", + "'/etc/httpd/conf.modules.d/00-mpm.conf'")); + print_and_log("\n"); + } + } +} + ############################################### ## ## Copy loncapassl.conf and sslrewrite.conf