[LON-CAPA-cvs] cvs: doc(version_2_11_X) /loncapafiles webserver.piml

raeburn raeburn at source.lon-capa.org
Fri Mar 12 18:17:04 EST 2021


raeburn		Fri Mar 12 23:17:04 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/loncapafiles	webserver.piml 
  Log:
  - For 2.11
    Backport 1.56
  
  
Index: doc/loncapafiles/webserver.piml
diff -u doc/loncapafiles/webserver.piml:1.43.2.9 doc/loncapafiles/webserver.piml:1.43.2.10
--- doc/loncapafiles/webserver.piml:1.43.2.9	Thu Mar 11 20:45:03 2021
+++ doc/loncapafiles/webserver.piml	Fri Mar 12 23:17:04 2021
@@ -2,7 +2,7 @@
 	"http://lpml.sourceforge.net/DTD/piml.dtd">
 <!-- webserver.piml -->
 
-<!-- $Id: webserver.piml,v 1.43.2.9 2021/03/11 20:45:03 raeburn Exp $ -->
+<!-- $Id: webserver.piml,v 1.43.2.10 2021/03/12 23:17:04 raeburn Exp $ -->
 
 <!--
 
@@ -69,6 +69,8 @@
 # Generated from doc/loncapafiles/webserver.piml
 use Socket;
 use Sys::Hostname::FQDN();
+use File::Spec;
+use Cwd();
 
 # For ubuntu 14 and later check for loncapa.conf in sites-available,
 # and conf-available, and for symlinks in sites-enabled, and conf-enabled
@@ -77,6 +79,9 @@
     if ($version > 12) {
         if (-l '/etc/apache2/conf-enabled/loncapa.conf') {
             my $linkfname = readlink('/etc/apache2/conf-enabled/loncapa.conf');
+            if ($linkfname ne '') {
+                $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,'/etc/apache2/conf-enabled'));
+            }
             unless ($linkfname eq '/etc/apache2/conf-available/loncapa.conf') {
                 unlink('/etc/apache2/conf-enabled/loncapa.conf');
             }
@@ -86,12 +91,21 @@
         }
         unless (-l '/etc/apache2/conf-enabled/loncapa.conf') {
             if (-e '/etc/apache2/conf-available/loncapa.conf') {
-                symlink('/etc/apache2/conf-available/loncapa.conf','/etc/apache2/conf-enabled/loncapa.conf');
+                my $currdir = Cwd::getcwd();
+                if ($currdir ne '') {
+                    chdir('/etc/apache2/conf-enabled');
+                    symlink('../conf-available/loncapa.conf','loncapa.conf');
+                    chdir($currdir);
+                }
             }
         }
         if (-l '/etc/apache2/sites-enabled/000-default.conf') {
             my $linkfname = readlink('/etc/apache2/sites-enabled/000-default.conf');
-            if ($linkfname eq '/etc/apache2/sites-available/loncapa') {
+            if ($linkfname ne '') {
+                $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,'/etc/apache2/sites-enabled'));
+            }
+            if (($linkfname eq '/etc/apache2/sites-available/loncapa') ||
+                ($linkname eq '/etc/apache2/sites-available/000-default.conf')) {
                 unlink('/etc/apache2/sites-enabled/000-default.conf');
             }
         }
@@ -100,13 +114,21 @@
         }
         if (-l '/etc/apache2/sites-enabled/loncapa.conf') {
             my $linkfname = readlink('/etc/apache2/sites-enabled/loncapa.conf');
+            if ($linkfname ne '') {
+                $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,'/etc/apache2/sites-enabled'));
+            }
             unless ($linkfname eq '/etc/apache2/sites-available/loncapa.conf') {
                 unlink('/etc/apache2/sites-enabled/loncapa.conf');
             }
         }
         unless (-l '/etc/apache2/sites-enabled/loncapa.conf') {
             if (-e '/etc/apache2/sites-available/loncapa.conf') {
-                symlink('/etc/apache2/sites-available/loncapa.conf','/etc/apache2/sites-enabled/loncapa.conf');
+                my $currdir = Cwd::getcwd();
+                if ($currdir ne '') {
+                    chdir('/etc/apache2/sites-enabled');
+                    symlink('../sites-available/loncapa.conf','loncapa.conf');
+                    chdir($currdir);
+                }
             }
         }
     }




More information about the LON-CAPA-cvs mailing list