MESSAGE
DATE | 2021-04-16 |
FROM | From: "John A."
|
SUBJECT | Subject: [Hangout - NYLXS] Fixing Apache::ReadConfig limitations
|
From hangout-bounces-at-nylxs.com Sun Apr 18 17:29:02 2021 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www2.mrbrklyn.com (www2.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id 02E24163FD4; Sun, 18 Apr 2021 17:29:01 -0400 (EDT) X-Original-To: hangout-at-www2.mrbrklyn.com Delivered-To: hangout-at-www2.mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 1000) id 5FF65163FB8; Sun, 18 Apr 2021 17:28:50 -0400 (EDT) Resent-From: Ruben Safir Resent-Date: Sun, 18 Apr 2021 17:28:50 -0400 Resent-Message-ID: <20210418212850.GD27042-at-www2.mrbrklyn.com> Resent-To: hangout-at-mrbrklyn.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mrbrklyn.com (Postfix) with ESMTP id 6143C163FB0 for ; Fri, 16 Apr 2021 14:10:13 -0400 (EDT) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id D5CB75FE95 for ; Fri, 16 Apr 2021 18:10:08 +0000 (UTC) Received: (qmail 39974 invoked by uid 500); 16 Apr 2021 18:10:07 -0000 Mailing-List: contact modperl-help-at-perl.apache.org; run by ezmlm Precedence: bulk Delivered-To: mailing list modperl-at-perl.apache.org Received: (qmail 39959 invoked by uid 99); 16 Apr 2021 18:10:07 -0000 Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Apr 2021 18:10:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 9C6A71FF468 for ; Fri, 16 Apr 2021 18:10:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: 1.844 X-Spam-Level: * X-Spam-Status: No, score=1.844 tagged_above=-999 required=6.31 tests=[FORGED_MUA_MOZILLA=1.596, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-ec2-va.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id LEPHfjvOxKww for ; Fri, 16 Apr 2021 18:10:04 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=116.202.254.214; helo=ciao.gmane.io; envelope-from=gcam-modperl-at-m.gmane-mx.org; receiver= Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 03B66BCFE4 for ; Fri, 16 Apr 2021 18:10:03 +0000 (UTC) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lXSuo-0000IF-5c for modperl-at-perl.apache.org; Fri, 16 Apr 2021 20:10:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: modperl-at-perl.apache.org From: "John A." Date: Fri, 16 Apr 2021 19:27:31 +0200 Message-ID: Mime-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-Mozilla-News-Host: news://news.gmane.io:119 Subject: [Hangout - NYLXS] Fixing Apache::ReadConfig limitations X-BeenThere: hangout-at-nylxs.com X-Mailman-Version: 2.1.30rc1 List-Id: NYLXS Tech Talk and Politics List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: hangout-bounces-at-nylxs.com Sender: "Hangout"
Presently, Apache::ReadConfig doesn't seem to provide a way to represent the order of directives, which limits its usefulness when used with modules like mod_rewrite that rely on the order of certain directives:
ServerName example.com DirectoryRoot /www RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) cgit.cgi/$1 [END,QSA]
This piece of configuration is (AFAIK?) impossible to create using Apache::ReadConfig, because %VirtualHost and %Directory are unordered hashes.
Assuming I'm correct about the problem, what could be done to fix it?
My personal idea is to create an additional module created Apache::ReadConfig::Full (or something), which allows the following:
$Config->push(['VirtualHost', '*:80'] => block( ServerName => 'example.com', DirectoryRoot => '/www', ['Directory', '/www'] => block( RewriteEngine => On, RewriteCond => '%{REQUEST_FILENAME} !-f', RewriteCond => '%{REQUEST_FILENAME} !-d', RewriteRule => '(.*) cgit.cgi/$1 [END,QSA]' ) );
The `block' function creates an object that amounts to an ordered, multi-value hash a la Hash::MultiValue. (The global $Config variable is the same type of object.)
Before I start looking into the possibility of creating such an interface, I thought I'd ask here whether my assumptions about Apache::ReadConfig's limitations are correct.
Best regards John _______________________________________________ Hangout mailing list Hangout-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/hangout
|
|