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

raeburn raeburn at source.lon-capa.org
Mon Aug 5 11:55:00 EDT 2024


raeburn		Mon Aug  5 15:55:00 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/loncapafiles	webserver.piml 
  Log:
  - For 2.11
    Backport 1.62 
  
  
Index: doc/loncapafiles/webserver.piml
diff -u doc/loncapafiles/webserver.piml:1.43.2.12 doc/loncapafiles/webserver.piml:1.43.2.13
--- doc/loncapafiles/webserver.piml:1.43.2.12	Sat Jun 29 16:06:57 2024
+++ doc/loncapafiles/webserver.piml	Mon Aug  5 15:55:00 2024
@@ -2,7 +2,7 @@
 	"http://lpml.sourceforge.net/DTD/piml.dtd">
 <!-- webserver.piml -->
 
-<!-- $Id: webserver.piml,v 1.43.2.12 2024/06/29 16:06:57 raeburn Exp $ -->
+<!-- $Id: webserver.piml,v 1.43.2.13 2024/08/05 15:55:00 raeburn Exp $ -->
 
 <!--
 
@@ -142,18 +142,60 @@
 else {
   # Append loncapa_apache.conf inclusion to httpd.conf 
   # (or sites-available/loncapa or conf-available/loncapa.conf) if not present.
-  $flag=0;
-  open(IN,'<<TARGET />');
-  while (<IN>) { 
-    if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
-      $flag=1; 
+  my $absolute_link;
+  if ('<DIST />' =~ /^sles(\d+)$/) {
+    my $version = $1;
+    if ($version > 11) {
+      $absolute_link = 1;
     }
   }
-  close(IN);
-  unless ($flag==1) {
-    open(OUT,'>><TARGET />');
-    print(OUT 'Include conf/loncapa_apache.conf'."\n");
-    close(OUT);
+  if ($absolute_link) { 
+    # For SuSE and SLES /etc/apache2/default-server.conf needs to include:
+    # Include /etc/apache2/loncapa_apache.conf
+    # instead of:
+    # Include conf/loncapa_apache.conf
+    my $delflag=0;
+    my $addflag=1;
+    open(IN,'<<TARGET />');
+    while (<IN>) {
+      if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
+        $delflag=1;
+      }
+      if (/^\s*Include\s+\/etc\/apache2\/loncapa_apache.conf/) {
+        $addflag = 0;
+      }
+    }
+    close(IN);
+    if ($addflag) {
+      open(OUT,'>><TARGET />');
+      print(OUT 'Include /etc/apache2/loncapa_apache.conf'."\n");
+      close(OUT);
+    }
+    if ($delflag==1) {
+      my $in='';
+      open(IN,'<<TARGET />');
+      while(<IN>) {
+        $in.=$_ unless /^\s*Include\s+conf\/loncapa_apache.conf/;
+      }
+      close(IN);
+      open(OUT,'><TARGET />');
+      print(OUT $in);
+      close(OUT);
+    }
+  } else {
+    $flag=0;
+    open(IN,'<<TARGET />');
+    while (<IN>) { 
+      if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
+        $flag=1; 
+      }
+    }
+    close(IN);
+    unless ($flag==1) {
+      open(OUT,'>><TARGET />');
+      print(OUT 'Include conf/loncapa_apache.conf'."\n");
+      close(OUT);
+    }
   }
   # Remove loncapa.conf inclusion from httpd.conf 
   # (or sites-available/loncapa or conf-available/loncapa.conf) if present.




More information about the LON-CAPA-cvs mailing list