MESSAGE
DATE | 2021-04-16 |
FROM | From: "John A."
|
SUBJECT | Subject: [Hangout - NYLXS] Fixing Apache::ReadConfig limitations
|
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
|
|