[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-modperl
Subject: =?utf-8?Q?How_to_get_=E2=80=9Cmy=E2=80=9D_VHOST_in_code_executed_by_PerPostConfigR?= =?utf-8?Q?equir
From: Thorsten_Schöning <tschoening () am-soft ! de>
Date: 2019-08-05 17:18:56
Message-ID: 1615614728.20190805191856 () am-soft ! de
[Download RAW message or body]
Hi all,
I'm hosting multiple instances of the same web app in different
versions using the same instance of HTTPd and one VHOST per
instance/version of web app currently. I would like to use mod_perl's
"PostConfigRequire" to implement a handler pre-loading all those
instances during server startup instead of relying on mod_perl's
registry-facilities per request, as is done currently. The latter
[breaks][1] in case of too many concurrent requests and according to
some tests, that problem doesn't occur anymore in case things get
pre-loaded.
Because of the different versions of my web app, I need to use
"PerlOptions +Parent" to provide each VHOST with its individual Perl
interpreter pool. Additionally, I can easily configure
"PerlPostConfigRequire" per VHOST, but pre-loading needs to take into
account which VHOST that handler is currently executed in. Within that
handler I need to only load those files associated with some concrete
VHOST.
The problem is that I'm having trouble how to find the VHOST currently
executing that handler. In that past I have implemented something
similar per request by looking at the currently requested URL and
comparing that to VHOST configs, but I don't have a request now.
"Apache2::ServerUtil->server()" is not providing my VHOST, but it's
available at all e.g. using
"Apache2::Directive::conftree()->lookup('VirtualHost')". Only that I
don't know which one is the one containing "PerlPostConfigRequire"
currently executed. I'm pretty sure that "PerlPostConfigRequire"
really gets executed per VHOST, because I get debugging output scaling
with the number of VHOSTs configured as well.
Any ideas? Thanks!
[1]: http://mail-archives.apache.org/mod_mbox/perl-modperl/201907.mbox/%3C1116164701.20190731193313%40am-soft.de%3E
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme http://www.AM-SoFT.de/
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic