[LON-CAPA-cvs] cvs: doc /install/linux install.pl /install/linux/centos-rhes-fedora-sl mpm.conf

raeburn raeburn at source.lon-capa.org
Tue Oct 29 23:42:08 EDT 2019


raeburn		Wed Oct 30 03:42:08 2019 EDT

  Added files:                 
    /doc/install/linux/centos-rhes-fedora-sl	mpm.conf 

  Modified files:              
    /doc/install/linux	install.pl 
  Log:
  - Enable mpm_prefork_module in RHEL/CentOS/Scientific/Oracle Linux and
    Fedora.
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.58 doc/install/linux/install.pl:1.59
--- doc/install/linux/install.pl:1.58	Mon Oct  7 22:28:02 2019
+++ doc/install/linux/install.pl	Wed Oct 30 03:42:05 2019
@@ -77,7 +77,7 @@
           &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 @@
         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 @@
         }
     } 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 @@
             }
         } 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 @@
                 }
             }
         }
+        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 = <PIPE>;
+                    close(PIPE);
+                    chomp($diffres);
+                    if ($diffres) {
+                        $fixapache = 1;
+                    }
+                }
+            }
+        }
     }
     return $fixapache;
 }
@@ -1986,6 +2004,7 @@
         &copy_apache2_debconf($instdir,$distro,$hostname);
     } else {
         &copy_httpd_conf($instdir,$distro,$hostname);
+        &copy_mpm_conf($instdir,$distro);
     }
 } else {
     print_and_log(&mt('Skipping configuration of Apache web server.')."\n");
@@ -2577,6 +2596,50 @@
     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 &copy_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

Index: doc/install/linux/centos-rhes-fedora-sl/mpm.conf
+++ doc/install/linux/centos-rhes-fedora-sl/mpm.conf
# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines.  See the httpd.conf(5) man
# page for more information on changing the MPM.

# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
#
# NOTE: If enabling prefork, the httpd_graceful_shutdown SELinux
# boolean should be enabled, to allow graceful stop/shutdown.
#
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
#
#LoadModule mpm_worker_module modules/mod_mpm_worker.so

# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
#LoadModule mpm_event_module modules/mod_mpm_event.so





More information about the LON-CAPA-cvs mailing list