httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gillis J. de Nijs" <gil...@jink.net.INVALID>
Subject Re: [users@httpd] Allow relative paths in Directory directives?
Date Fri, 11 Sep 2020 10:23:52 GMT
Hi Erik,

Couldn't you do something like this?

<Directory "/www/*/public_html">

That should work just fine, if you have your vhosts in a common structure.
Alternatively, you could look at DirectoryMatch and come up with something
awful that matches your structure.

https://httpd.apache.org/docs/2.4/mod/core.html#directory
https://httpd.apache.org/docs/2.4/mod/core.html#directorymatch

Cheers,
Gillis

On Fri, Sep 11, 2020 at 11:30 AM Erik Thuning <thuning@dsv.su.se> wrote:

> Hi!
>
> This is something that I keep thinking about when I configure my various
> vhosts, and would like feedback on, along with a pointer to where I
> could request the change if it is actually sane.
>
> Currently, <Directory> directives require an absolute path. I would like
> to be able to use paths relative to the DocumentRoot by omitting the
> initial / in the path supplied in standard UNIX fashion (basically
> treating the DocumentRoot as the working directory). If the <Directory>
> is specified in a context without a set DocumentRoot, it would be
> considered an error.
>
> To me this would solve a long-standing issue with feeling compelled by
> my own laziness to use <Location> directives when I want to customize
> handling of directories inside the DocumentRoot. This is counter to the
> recommendations in the documentation but prepending the DocumentRoot
> path everywhere is both cumbersome and error-prone, so I usually go for
> the "bad" approach.
>
> Adding support for relative <Directory> directives could also make
> certain configurations more portable by only needing to change the
> DocumentRoot when cloning a vhost to a new directory, instead of having
> to update all instances of <Directory> as well.
>
> I haven't been able to find any explicit rationale for the way the
> directive works right now, so I don't know if I'm missing anything
> fundamental that would make this unworkable. I would be thankful for any
> feedback pointing me to such a rationale if it exists.
>
> Regards
> Erik Thuning
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Mime
View raw message