Diff for /doc/install/linux/install.pl between versions 1.71 and 1.76

version 1.71, 2021/03/16 01:03:04 version 1.76, 2021/03/28 21:51:22
Line 212  sub get_distro { Line 212  sub get_distro {
             $distro = 'rhes'.$1;              $distro = 'rhes'.$1;
             $updatecmd = 'dnf install LONCAPA-prerequisites';              $updatecmd = 'dnf install LONCAPA-prerequisites';
             $installnow = 'dnf -y install LONCAPA-prerequisites';              $installnow = 'dnf -y install LONCAPA-prerequisites';
         } elsif ($versionstring =~ /CentOS(?:| Linux) release (\d+)/) {          } elsif ($versionstring =~ /CentOS(?:| Linux| Stream) release (\d+)/) {
             $distro = 'centos'.$1;              $distro = 'centos'.$1;
             $updatecmd = 'yum install LONCAPA-prerequisites';              $updatecmd = 'yum install LONCAPA-prerequisites';
             $installnow = 'yum -y install LONCAPA-prerequisites';              $installnow = 'yum -y install LONCAPA-prerequisites';
Line 886  sub uses_firewalld { Line 886  sub uses_firewalld {
     }      }
     if ($checkfirewalld) {      if ($checkfirewalld) {
         my ($loaded,$active);          my ($loaded,$active);
         if (open(PIPE,"systemctl status firewalld |")) {          if (open(PIPE,"systemctl status firewalld 2>/dev/null |")) {
             while (<PIPE>) {              while (<PIPE>) {
                 chomp();                  chomp();
                 if (/^\s*Loaded:\s+(\w+)/) {                  if (/^\s*Loaded:\s+(\w+)/) {
                     $loaded = $1;                      $loaded = $1;
                 }                  }
                 if (/^\s*Active\s+(\w+)/) {                  if (/^\s*Active:\s+(\w+)/) {
                     $active = $1;                      $active = $1;
                 }                  }
             }              }
Line 2047  if ($callsub{'pwauth'}) { Line 2047  if ($callsub{'pwauth'}) {
 if ($callsub{'mysql'}) {  if ($callsub{'mysql'}) {
     if ($dbh) {      if ($dbh) {
         &setup_mysql($callsub{'mysqlperms'},$dbh,$has_pass,          &setup_mysql($callsub{'mysqlperms'},$dbh,$has_pass,
                      $mysql_unix_socket,$has_lcdb);                       $mysql_unix_socket,$has_lcdb,$distro);
     } else {      } else {
         print &mt('Unable to configure MySQL because access is denied.')."\n";          print &mt('Unable to configure MySQL because access is denied.')."\n";
     }      }
Line 2170  if ($callsub{'firewall'}) { Line 2170  if ($callsub{'firewall'}) {
         if (keys(%added) > 0) {          if (keys(%added) > 0) {
             print &mt('Firewall configured to allow access for: [_1].',              print &mt('Firewall configured to allow access for: [_1].',
                       join(', ',sort(keys(%added))))."\n";                        join(', ',sort(keys(%added))))."\n";
               system('firewall-cmd --reload'); 
         }          }
         if ($current{'http'} || $current{'https'}) {          if ($current{'http'} || $current{'https'}) {
             print &mt('Firewall already configured to allow access for:[_1].',              print &mt('Firewall already configured to allow access for:[_1].',
                       (($current{'http'})? ' http':'').(($current{'https'})? ' https':''))."\n";                        (($current{'http'})? ' http':'').(($current{'https'})? ' https':''))."\n";
         }          }
         unless ($current{'ssh'}) {          unless ($current{'ssh'}) {
             print &mt('If you would the like to allow access to ssh from outside, use the command[_1].',              print &mt('If you would like to allow access to ssh from outside, use the commands:')."\n".
                   "firewall-cmd --permanent --zone=$zone --add-service=ssh")."\n";                    "firewall-cmd --permanent --zone=$zone --add-service=ssh\n".
                     "firewall-cmd --reload\n";
         }          }
     } elsif ($distro =~ /^(suse|sles)/) {      } elsif ($distro =~ /^(suse|sles)/) {
         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].',
Line 2516  sub kill_extra_services { Line 2518  sub kill_extra_services {
 }  }
   
 sub setup_mysql {  sub setup_mysql {
     my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb) = @_;      my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb,$distro) = @_;
     my @mysql_lc_commands;      my @mysql_lc_commands;
     unless ($has_lcdb) {      unless ($has_lcdb) {
         push(@mysql_lc_commands,"CREATE DATABASE loncapa");          my $createcmd = 'CREATE DATABASE loncapa';
           if ($distro =~ /^sles(\d+)/) {
               if ($1 > 11) {
                   $createcmd .= ' CHARACTER SET utf8 COLLATE utf8_general_ci';
               }
           } elsif ($distro =~ /^ubuntu(\d+)/) {
               if ($1 > 16) {
                   $createcmd .= ' CHARACTER SET latin1 COLLATE latin1_swedish_ci';
               }
           }
           push(@mysql_lc_commands,$createcmd);
     }      }
     push(@mysql_lc_commands,"USE loncapa");      push(@mysql_lc_commands,"USE loncapa");
     push(@mysql_lc_commands,qq{      push(@mysql_lc_commands,qq{
Line 2565  sub setup_mysql_permissions { Line 2577  sub setup_mysql_permissions {
     if ($usescreate) {      if ($usescreate) {
         @mysql_commands = ("CREATE USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");          @mysql_commands = ("CREATE USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
     } elsif ($usesauth) {      } elsif ($usesauth) {
         @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')");          @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')",
                              "FLUSH PRIVILEGES");
         if ($is_mariadb) {          if ($is_mariadb) {
             push(@mysql_commands,"ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");              push(@mysql_commands,"ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
         } else {          } else {

Removed from v.1.71  
changed lines
  Added in v.1.76


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>