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
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
# 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) {
# 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;
--- /dev/null
+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>
+-------------------------------------------------------------------