version 1.55, 2019/07/02 19:40:35
|
version 1.59, 2019/10/30 03:42:05
|
Line 451 sub check_locale {
|
Line 451 sub check_locale {
|
print &mt('Failed to open: [_1], default locale not checked.', |
print &mt('Failed to open: [_1], default locale not checked.', |
'/etc/sysconfig/i18n'); |
'/etc/sysconfig/i18n'); |
} |
} |
} elsif ($distro =~ /^(?:rhes|centos|scientific)(\d+)/) { |
} elsif ($distro =~ /^(?:rhes|centos|scientific|oracle)(\d+)/) { |
if ($1 >= 7) { |
if ($1 >= 7) { |
if (!open($fh,"</etc/locale.conf")) { |
if (!open($fh,"</etc/locale.conf")) { |
print &mt('Failed to open: [_1], default locale not checked.', |
print &mt('Failed to open: [_1], default locale not checked.', |
Line 480 sub check_locale {
|
Line 480 sub check_locale {
|
$command = 'sudo locale-gen en_US.UTF-8'."\n". |
$command = 'sudo locale-gen en_US.UTF-8'."\n". |
'sudo update-locale LANG=en_US.UTF-8'; |
'sudo update-locale LANG=en_US.UTF-8'; |
} elsif ($distro =~ /^(suse|sles)/) { |
} elsif ($distro =~ /^(suse|sles)/) { |
$command = 'yast language'; |
$command = 'yast language'; |
} elsif (-e '/usr/bin/system-config-language') { |
} elsif (-e '/usr/bin/system-config-language') { |
$command = 'system-config-language'; |
$command = 'system-config-language'; |
} elsif (-e '/usr/bin/localectl') { |
} elsif (-e '/usr/bin/localectl') { |
$command = 'localectl set-locale en_US.UTF-8'; |
$command = '/usr/bin/localectl set-locale LANG=en_US.UTF-8'; |
} else { |
} else { |
$command = 'No standard command found'; |
$command = 'No standard command found'; |
} |
} |
Line 607 sub check_mysql_running {
|
Line 607 sub check_mysql_running {
|
if ($1 >= 19) { |
if ($1 >= 19) { |
$mysqldaemon ='mariadb'; |
$mysqldaemon ='mariadb'; |
} |
} |
} elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) { |
} elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) { |
if ($1 >= 7) { |
if ($1 >= 7) { |
$mysqldaemon ='mariadb'; |
$mysqldaemon ='mariadb'; |
$process = 'mysqld'; |
$process = 'mysqld'; |
Line 748 sub chkconfig {
|
Line 748 sub chkconfig {
|
if ($version >= 19) { |
if ($version >= 19) { |
$daemon{'mysql'} = 'mariadb'; |
$daemon{'mysql'} = 'mariadb'; |
} |
} |
} elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) { |
if ($version >= 26) { |
|
$daemon{'ntp'} = 'chronyd'; |
|
} |
|
} elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) { |
my $version = $1; |
my $version = $1; |
if ($version >= 7) { |
if ($version >= 7) { |
$uses_systemctl{'ntp'} = 1; |
$uses_systemctl{'ntp'} = 1; |
Line 758 sub chkconfig {
|
Line 761 sub chkconfig {
|
$uses_systemctl{'cups'} = 1; |
$uses_systemctl{'cups'} = 1; |
$daemon{'mysql'} = 'mariadb'; |
$daemon{'mysql'} = 'mariadb'; |
} |
} |
if ($version >= 8) { |
if (($version >= 8) || ($distro eq 'oracle7')) { |
$daemon{'ntp'} = 'chronyd'; |
$daemon{'ntp'} = 'chronyd'; |
} |
} |
} |
} |
Line 864 sub uses_firewalld {
|
Line 867 sub uses_firewalld {
|
if ($1 >= 18) { |
if ($1 >= 18) { |
$checkfirewalld = 1; |
$checkfirewalld = 1; |
} |
} |
} elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) { |
} elsif ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)/) { |
if ($1 >= 7) { |
if ($1 >= 7) { |
$checkfirewalld = 1; |
$checkfirewalld = 1; |
} |
} |
Line 1006 sub chkapache {
|
Line 1009 sub chkapache {
|
} elsif ($distro =~ /^(suse|sles)([\d\.]+)$/) { |
} elsif ($distro =~ /^(suse|sles)([\d\.]+)$/) { |
my ($name,$version) = ($1,$2); |
my ($name,$version) = ($1,$2); |
my $apache = 'apache'; |
my $apache = 'apache'; |
my $conf_file = "$instdir/sles-suse/default-server.conf"; |
my $conf_file = "$instdir/sles-suse/default-server.conf"; |
if ($version >= 10) { |
if ($version >= 10) { |
$apache = 'apache2'; |
$apache = 'apache2'; |
} |
} |
if (($name eq 'sles') && ($version >= 12)) { |
if (($name eq 'sles') && ($version >= 12)) { |
$conf_file = "$instdir/sles-suse/apache2.4/default-server.conf"; |
$conf_file = "$instdir/sles-suse/apache2.4/default-server.conf"; |
} |
} |
if (!-e "$conf_file") { |
if (!-e $conf_file) { |
$fixapache = 0; |
$fixapache = 0; |
print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; |
print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; |
} elsif (-e "/etc/$apache/default-server.conf") { |
} elsif (-e "/etc/$apache/default-server.conf") { |
Line 1042 sub chkapache {
|
Line 1045 sub chkapache {
|
} |
} |
} else { |
} else { |
my $configfile = 'httpd.conf'; |
my $configfile = 'httpd.conf'; |
if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { |
my $mpmfile = 'mpm.conf'; |
|
if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) { |
if ($1 >= 7) { |
if ($1 >= 7) { |
$configfile = 'apache2.4/httpd.conf'; |
$configfile = 'apache2.4/httpd.conf'; |
} elsif ($1 > 5) { |
} elsif ($1 > 5) { |
Line 1050 sub chkapache {
|
Line 1054 sub chkapache {
|
} |
} |
} elsif ($distro =~ /^fedora(\d+)$/) { |
} elsif ($distro =~ /^fedora(\d+)$/) { |
if ($1 > 17) { |
if ($1 > 17) { |
$configfile = 'apache2.4/httpd.conf'; |
$configfile = 'apache2.4/httpd.conf'; |
} elsif ($1 > 10) { |
} elsif ($1 > 10) { |
$configfile = 'new/httpd.conf'; |
$configfile = 'new/httpd.conf'; |
} |
} |
Line 1068 sub chkapache {
|
Line 1072 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 = <PIPE>; |
|
close(PIPE); |
|
chomp($diffres); |
|
if ($diffres) { |
|
$fixapache = 1; |
|
} |
|
} |
|
} |
|
} |
} |
} |
return $fixapache; |
return $fixapache; |
} |
} |
Line 1819 if ($distro eq '') {
|
Line 1837 if ($distro eq '') {
|
print "\n".&mt('Linux distribution could not be verified as a supported distribution.')."\n". |
print "\n".&mt('Linux distribution could not be verified as a supported distribution.')."\n". |
&mt('The following are supported: [_1].', |
&mt('The following are supported: [_1].', |
'CentOS, RedHat Enterprise, Fedora, Scientific Linux, '. |
'CentOS, RedHat Enterprise, Fedora, Scientific Linux, '. |
'openSuSE, SLES, Ubuntu LTS, Debian')."\n\n". |
'Oracle Linux, openSuSE, SLES, Ubuntu LTS, Debian')."\n\n". |
&mt('Stopping execution.')."\n"; |
&mt('Stopping execution.')."\n"; |
exit; |
exit; |
} |
} |
Line 1986 if ($callsub{'apache'}) {
|
Line 2004 if ($callsub{'apache'}) {
|
©_apache2_debconf($instdir,$distro,$hostname); |
©_apache2_debconf($instdir,$distro,$hostname); |
} else { |
} else { |
©_httpd_conf($instdir,$distro,$hostname); |
©_httpd_conf($instdir,$distro,$hostname); |
|
©_mpm_conf($instdir,$distro); |
} |
} |
} else { |
} else { |
print_and_log(&mt('Skipping configuration of Apache web server.')."\n"); |
print_and_log(&mt('Skipping configuration of Apache web server.')."\n"); |
Line 2106 if ($callsub{'firewall'}) {
|
Line 2125 if ($callsub{'firewall'}) {
|
} |
} |
} |
} |
} |
} |
} elsif ($distro =~ /^scientific/) { |
} elsif ($distro =~ /^(scientific|oracle)/) { |
print &mt('Use [_1] to configure the firewall to allow access for [_2].', |
print &mt('Use [_1] to configure the firewall to allow access for [_2].', |
'system-config-firewall-tui -- Customize', |
'system-config-firewall-tui -- Customize', |
'ssh, http')."\n"; |
'ssh, http')."\n"; |
Line 2556 sub get_mysql_version {
|
Line 2575 sub get_mysql_version {
|
sub copy_httpd_conf { |
sub copy_httpd_conf { |
my ($instdir,$distro,$hostname) = @_; |
my ($instdir,$distro,$hostname) = @_; |
my $configfile = 'httpd.conf'; |
my $configfile = 'httpd.conf'; |
if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { |
if ($distro =~ /^(?:centos|rhes|scientific|oracle)(\d+)$/) { |
if ($1 >= 7) { |
if ($1 >= 7) { |
$configfile = 'apache2.4/httpd.conf'; |
$configfile = 'apache2.4/httpd.conf'; |
} elsif ($1 > 5) { |
} elsif ($1 > 5) { |
Line 2577 sub copy_httpd_conf {
|
Line 2596 sub copy_httpd_conf {
|
print_and_log("\n"); |
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 |
## Copy loncapassl.conf and sslrewrite.conf |
Line 3182 sub copy_sysconfig_apache2_file {
|
Line 3245 sub copy_sysconfig_apache2_file {
|
if (($name eq 'sles') && ($version >= 12)) { |
if (($name eq 'sles') && ($version >= 12)) { |
$sysconf_file = "$instdir/sles-suse/apache2.4/sysconfig_apache2"; |
$sysconf_file = "$instdir/sles-suse/apache2.4/sysconfig_apache2"; |
} |
} |
copy "$sysconf_file","/etc/sysconfig/apache2"; |
copy $sysconf_file,"/etc/sysconfig/apache2"; |
chmod(0444,"/etc/sysconfig/apache2"); |
chmod(0444,"/etc/sysconfig/apache2"); |
} |
} |
|
|