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

raeburn raeburn at source.lon-capa.org
Mon Aug 5 11:45:16 EDT 2024


raeburn		Mon Aug  5 15:45:16 2024 EDT

  Modified files:              
    /doc/loncapafiles	webserver.piml 
  Log:
  - doc/install/linux/sles-suse/apache2.4/default-server.conf used for 
    Apache 2.4 (SLES >= 12) includes absolute path for loncapa_apache.conf
  - Do not add an Include with a relative path, so install.pl run post-installation
    will no longer prompt: "Configure Apache web server?(Y/n).
  
  
Index: doc/loncapafiles/webserver.piml
diff -u doc/loncapafiles/webserver.piml:1.61 doc/loncapafiles/webserver.piml:1.62
--- doc/loncapafiles/webserver.piml:1.61	Thu Jun 20 04:04:55 2024
+++ doc/loncapafiles/webserver.piml	Mon Aug  5 15:45:16 2024
@@ -2,7 +2,7 @@
 	"http://lpml.sourceforge.net/DTD/piml.dtd">
 <!-- webserver.piml -->
 
-<!-- $Id: webserver.piml,v 1.61 2024/06/20 04:04:55 raeburn Exp $ -->
+<!-- $Id: webserver.piml,v 1.62 2024/08/05 15:45:16 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