[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. 6e6fa755f5c667cc2138cfc38fea70d72112ad5b

Evergreen Git git at git.evergreen-ils.org
Tue Jun 20 15:03:55 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_12 has been updated
       via  6e6fa755f5c667cc2138cfc38fea70d72112ad5b (commit)
      from  d5803023359dadd5169e24e71158e989f878a2eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e6fa755f5c667cc2138cfc38fea70d72112ad5b
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed May 24 16:00:09 2017 -0400

    LP#1691473 Internal Apache HTTP port configuration
    
    Adds an optional new Apache/mod_perl configuration variable for defining
    the port Apache listens on for HTTP traffic.  This resolves an issue
    where added content lookups attempting HTTP requests on the local Apache
    instance on port 80 failed because Apache was using non-standard ports.
    
    To test:
    
    [1] Set a value for OILSWebInternalHTTPPort that's not "80".
    [2] Restart/reload Apache
    [3] Load a record detail in the catalog
    [4] Confirm opensrf logs show:
    
    "tpac: added content connecting to <ip-address>:<new-port> / <hostname>
    
    <new-port> should be the value configured for OILSWebInternalHTTPPort.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index a413821..bec5af1 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -628,6 +628,12 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     PerlSetVar OILSWebWebDir "@localstatedir@/web"
     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
 
+    # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
+    # routed from Perl handlers back to the same Apache instance, like
+    # added content requests.  Use this when running Apache with a 
+    # non-standard port, typical with a proxy setup.  Defaults to "80".
+    # PerlSetVar OILSWebInternalHTTPPort "7080"
+
     # Enable Template-Toolkit error debugging messages (apache error log)
     PerlSetVar OILSWebDebugTemplate "false"
     # local cache of compiled Template Toolkit templates
diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in
index 5821c28..11fc752 100644
--- a/Open-ILS/examples/apache_24/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in
@@ -618,6 +618,12 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     PerlSetVar OILSWebWebDir "@localstatedir@/web"
     PerlSetVar OILSWebDefaultTemplateExtension "tt2"
 
+    # Port Apache listens on for HTTP traffic.  Used for HTTP requests 
+    # routed from Perl handlers back to the same Apache instance, like
+    # added content requests.  Use this when running Apache with a 
+    # non-standard port, typical with a proxy setup.  Defaults to "80".
+    # PerlSetVar OILSWebInternalHTTPPort "7080"
+
     # Enable Template-Toolkit error debugging messages (apache error log)
     PerlSetVar OILSWebDebugTemplate "false"
     # local cache of compiled Template Toolkit templates
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 98aef3c..114de0c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -537,10 +537,14 @@ sub added_content_stage1 {
     # This avoids us having to route out of the cluster 
     # and back in to reach the top-level virtualhost.
     my $ac_addr = $ENV{SERVER_ADDR};
+    # Internal connections are HTTP-only (no HTTPS) and assume the
+    # connection port is '80' unless otherwise specified in the Apache
+    # configuration (e.g. for proxy setups)
+    my $ac_port = $self->apache->dir_config('OILSWebInternalHTTPPort') || 80;
     my $ac_host = $self->apache->hostname;
     my $ac_failed = 0;
 
-    $logger->info("tpac: added content connecting to $ac_addr / $ac_host");
+    $logger->info("tpac: added content connecting to $ac_addr:$ac_port / $ac_host");
 
     $ctx->{added_content} = {};
     for my $type (@$ac_types) {
@@ -556,9 +560,10 @@ sub added_content_stage1 {
         # Connecting to oneself should either be very fast (normal) 
         # or very slow (routing problems).
 
-        my $req = Net::HTTP::NB->new(Host => $ac_addr, Timeout => 1);
+        my $req = Net::HTTP::NB->new(
+            Host => $ac_addr, Timeout => 1, PeerPort => $ac_port);
         if (!$req) {
-            $logger->warn("Unable to connect to $ac_addr / $ac_host".
+            $logger->warn("Unable to connect to $ac_addr:$ac_port / $ac_host".
                 " for added content lookup for $rec_id: $@");
             $ac_failed = 1;
             next;
diff --git a/docs/RELEASE_NOTES_NEXT/Administration/apache-internal-http-port.adoc b/docs/RELEASE_NOTES_NEXT/Administration/apache-internal-http-port.adoc
new file mode 100644
index 0000000..9d61d58
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Administration/apache-internal-http-port.adoc
@@ -0,0 +1,16 @@
+Apache Internal Port Configuration Option
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Apache configuration now supports a new variable which allows admins to
+specify the port used by Apache to handle HTTP traffic.  The value is
+used for HTTP requests routed from Perl handlers back to the same Apache
+instance, like added content requests.  Use this when running Apache
+with a non-standard port, typical with a proxy setup.  Defaults to "80".
+
+[source,conf]
+-------------------------------------------------------------------
+<Location /eg>
+    ...
+    PerlSetVar OILSWebInternalHTTPPort "7080"
+    ...
+</Location>
+-------------------------------------------------------------------

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/apache/eg_vhost.conf.in          |    6 ++++++
 Open-ILS/examples/apache_24/eg_vhost.conf.in       |    6 ++++++
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |   11 ++++++++---
 .../Administration/apache-internal-http-port.adoc  |   16 ++++++++++++++++
 4 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/apache-internal-http-port.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list