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

raeburn raeburn at source.lon-capa.org
Sun Sep 6 17:48:28 EDT 2020


raeburn		Sun Sep  6 21:48:28 2020 EDT

  Modified files:              
    /doc/loncapafiles	webserver.piml 
  Log:
  - Fix check of rewrite rules for https -> http
  
  
Index: doc/loncapafiles/webserver.piml
diff -u doc/loncapafiles/webserver.piml:1.53 doc/loncapafiles/webserver.piml:1.54
--- doc/loncapafiles/webserver.piml:1.53	Sun Sep  6 18:13:11 2020
+++ doc/loncapafiles/webserver.piml	Sun Sep  6 21:48:28 2020
@@ -2,7 +2,7 @@
 	"http://lpml.sourceforge.net/DTD/piml.dtd">
 <!-- webserver.piml -->
 
-<!-- $Id: webserver.piml,v 1.53 2020/09/06 18:13:11 raeburn Exp $ -->
+<!-- $Id: webserver.piml,v 1.54 2020/09/06 21:48:28 raeburn Exp $ -->
 
 <!--
 
@@ -245,7 +245,8 @@
                 my @rewrites;
                 if (opendir(my $dir,$ssldir)) {
                     my @sslconf_files;
-                    foreach my $file (!grep(/^\.$/,readdir($dir))) {
+                    foreach my $file (grep(!/^\./,readdir($dir))) {
+                        next if ($file =~ /\.rpmnew$/);
                         if (open(my $fh,'<',"$ssldir/$file")) {
                             while (<$fh>) {
                                 if (/^\s*<VirtualHost\s+[^:]*\:443>\s*$/) {
@@ -257,18 +258,17 @@
                         }
                     }
                     if (@sslconf_files) {
-                        my @rewrites;
                         foreach my $file (@sslconf_files) {
                             if (open(my $fh,'<',"$ssldir/$file")) {
                                 my ($rewrite,$num) = (0,0);
                                 while (<$fh>) {
                                     if ($rewrite) {
-                                        if (/\s*<\/IfModule>/) {
+                                        if (/^\s*<\/IfModule>/) {
                                             $rewrite = 0;
                                             $num ++;
                                         } else {
                                             chomp();
-                                            s/^(\s+|\s+)$//g;
+                                            s/^\s+|\s+$//g;
                                             push(@{$rewrites[$num]},$_);
                                         }
                                     } elsif (/^\s*<IfModule\s+mod_rewrite.c>/) {
@@ -293,7 +293,7 @@
                                     }
                                 }
                             }
-                            if ($found >= @expected) {
+                            if ($found >= scalar(@expected)) {
                                 $gotrules = 1;
                                 last;
                             }




More information about the LON-CAPA-cvs mailing list