[LON-CAPA-cvs] cvs: doc(version_2_11_X) /install/linux install.pl

raeburn raeburn at source.lon-capa.org
Thu Mar 11 16:00:36 EST 2021


raeburn		Thu Mar 11 21:00:36 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/install/linux	install.pl 
  Log:
  - For 2.11
    Backport 1.69
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.45.2.9 doc/install/linux/install.pl:1.45.2.10
--- doc/install/linux/install.pl:1.45.2.9	Wed Nov 11 21:06:14 2020
+++ doc/install/linux/install.pl	Thu Mar 11 21:00:36 2021
@@ -75,7 +75,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.45.2.9 2020/11/11 21:06:14 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.45.2.10 2021/03/11 21:00:36 raeburn Exp $'."\n";
 }
 
 #
@@ -896,10 +896,10 @@
         } else {
             my ($configfile,$sitefile);
             if (($distname eq 'ubuntu') && ($version > 12)) {
-                $sitefile = '/etc/apache2/sites-available/loncapa';
-                $configfile = "/etc/apache2/conf-available/loncapa";
+                $sitefile = '/etc/apache2/sites-available/loncapa.conf';
+                $configfile = '/etc/apache2/conf-available/loncapa.conf';
             } else {
-                $configfile = "/etc/apache2/sites-available/loncapa";
+                $configfile = '/etc/apache2/sites-available/loncapa';
             }
             if (($configfile ne '') && (-e $configfile) && (-e $stdconf))  {
                 if (open(PIPE, "diff --brief $stdconf $configfile |")) {
@@ -2301,6 +2301,7 @@
     my $apache2_sites_enabled_dir = '/etc/apache2/sites-enabled';
     my $apache2_sites_available_dir = '/etc/apache2/sites-available';
     my $defaultconfig = "$apache2_sites_enabled_dir/000-default";
+    my $defaultsite = "$apache2_sites_enabled_dir/loncapa.conf";
     my ($distname,$version);
     if ($distro =~ /^(debian|ubuntu)(\d+)$/) {
         $distname = $1;
@@ -2320,11 +2321,31 @@
                 close(PIPE);
                 chomp($diffres);
                 if ($diffres) {
-                    copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.original");
+                    copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf.original");
+                } else {
+                    copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf");
+                    symlink("$apache2_conf_available_dir/loncapa.conf","$defaultconf");
                 }
                 if (-l $defaultconf) {
                     my $linkfname = readlink($defaultconf);
                     if ($linkfname eq "$apache2_conf_available_dir/loncapa") {
+                        unlink($defaultconf);
+                    }
+                }
+                unlink("$apache2_conf_available_dir/loncapa");
+            }
+        }
+        if ((-e "$apache2_conf_available_dir/loncapa.conf") && (-e "$instdir/debian-ubuntu/ubuntu14/loncapa_conf")) {
+            if (open(PIPE, "diff --brief $apache2_conf_available_dir/loncapa.conf $instdir/debian-ubuntu/ubuntu14/loncapa_conf |")) {
+                my $diffres = <PIPE>;
+                close(PIPE);
+                chomp($diffres);
+                if ($diffres) {
+                    copy("$apache2_conf_available_dir/loncapa.conf","$apache2_conf_available_dir/loncapa.conf.original");
+                }
+                if (-l $defaultconf) {
+                    my $linkfname = readlink($defaultconf);
+                    if ($linkfname eq "$apache2_conf_available_dir/loncapa.conf") {
                         unless ($diffres) {
                             $skipconf = 1;
                         }
@@ -2334,12 +2355,12 @@
         }
         unless ($skipconf) {
             print_and_log(&mt('Copying loncapa [_1] config file to [_2] and pointing [_3] to it from conf-enabled.',"'apache2'","'/etc/apache2/conf-available'","'loncapa.conf symlink'")."\n");
-            copy("$instdir/debian-ubuntu/ubuntu14/loncapa_conf","$apache2_conf_available_dir/loncapa");
-            chmod(0444,"$apache2_conf_available_dir/loncapa");
+            copy("$instdir/debian-ubuntu/ubuntu14/loncapa_conf","$apache2_conf_available_dir/loncapa.conf");
+            chmod(0444,"$apache2_conf_available_dir/loncapa.conf");
             if (-l $defaultconf) {
                 unlink($defaultconf);
             }
-            symlink("$apache2_conf_available_dir/loncapa","$defaultconf");
+            symlink("$apache2_conf_available_dir/loncapa.conf","$defaultconf");
         }
         my $stdsite = "$instdir/debian-ubuntu/ubuntu14/loncapa_site";
         if ((-e $stdsite) && (-e "$apache2_sites_available_dir/loncapa")) {
@@ -2348,11 +2369,30 @@
                 close(PIPE);
                 chomp($diffres);
                 if ($diffres) {
-                    copy("$apache2_sites_available_dir/loncapa","$apache2_sites_available_dir/loncapa.original");
+                    copy("$apache2_sites_available_dir/loncapa","$apache2_sites_available_dir/loncapa.conf.original");
+                } else {
+                    copy("$apache2_sites_available_dir/loncapa","$apache2_sites_available_dir/loncapa.conf");
                 }
                 if (-l $defaultconfig) {
                     my $linkfname = readlink($defaultconfig);
                     if ($linkfname eq "$apache2_sites_available_dir/loncapa") {
+                        unlink($defaultconfig);
+                    }
+                }
+                unlink("$apache2_sites_available_dir/loncapa");
+            }
+        }
+        if ((-e $stdsite) && (-e "$apache2_sites_available_dir/loncapa.conf")) {
+            if (open(PIPE, "diff --brief $stdsite $apache2_sites_available_dir/loncapa.conf |")) {
+                my $diffres = <PIPE>;
+                close(PIPE);
+                chomp($diffres);
+                if ($diffres) {
+                    copy("$apache2_sites_available_dir/loncapa.conf","$apache2_sites_available_dir/loncapa.conf.original");
+                }
+                if (-l $defaultsite) {
+                    my $linkfname = readlink($defaultsite);
+                    if ($linkfname eq "$apache2_conf_available_dir/loncapa.conf") {
                         unless ($diffres) {
                             $skipsite = 1;
                         }
@@ -2361,10 +2401,16 @@
             }
         }
         unless ($skipsite) {
-            print_and_log(&mt('Copying loncapa [_1] site file to [_2] and pointing [_3] to it from sites-enabled.',"'apache2'","'/etc/apache2/sites-available'","'000-default.conf symlink'")."\n");
-            copy("$instdir/debian-ubuntu/ubuntu14/loncapa_site","$apache2_sites_available_dir/loncapa");
-            chmod(0444,"$apache2_sites_available_dir/loncapa");
-            symlink("$apache2_sites_available_dir/loncapa","$defaultconfig");
+            print_and_log(&mt('Copying loncapa [_1] site file to [_2] and pointing [_3] to it from sites-enabled.',"'apache2'","'/etc/apache2/sites-available'","'loncapa.conf symlink'")."\n");
+            copy("$instdir/debian-ubuntu/ubuntu14/loncapa_site","$apache2_sites_available_dir/loncapa.conf");
+            chmod(0444,"$apache2_sites_available_dir/loncapa.conf");
+            symlink("$apache2_sites_available_dir/loncapa.conf","$defaultsite");
+        }
+        if (-l defaultconfig) {
+            my $linkfname = readlink($defaultconfig);
+            if ($linkfname eq "$apache2_sites_available_dir/000-default") {
+                unlink($defaultconfig);
+            }
         }
     } else {
         if ((-e "$instdir/debian-ubuntu/loncapa") && (-e "$apache2_sites_available_dir/loncapa")) {




More information about the LON-CAPA-cvs mailing list