Bug 64511 - Alias cannot appear in directory context, contrary to docs
Summary: Alias cannot appear in directory context, contrary to docs
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_alias (show other bugs)
Version: 2.4.43
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-10 11:11 UTC by mjr
Modified: 2020-06-10 20:03 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mjr 2020-06-10 11:11:33 UTC
Steps to Reproduce:
 1. Put an Alias (or ScriptAlias) inside a <Directory ...> or <If ...> tag pair in the configuration. https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias says it is OK in directory context.
 2. Run apache2ctl configtest

Actual Results:
  Alias cannot occur within directory context

Expected Results:
  Syntax OK

Build:
  2.4.43 built 2020-05-10T19:30:48
Comment 1 Christophe JAILLET 2020-06-10 19:30:44 UTC
For the records, the French doc is not in line with it.
Comment 2 mjr 2020-06-10 19:47:47 UTC
Thank you for the information.

Directory context appears to have been added by revision 1731088 but the commit message does not clarify it for me.

https://svn.apache.org/viewvc?view=revision&revision=1731088
Comment 3 Christophe JAILLET 2020-06-10 19:49:27 UTC
The doc should be tweaked.

The "directory" mentioned is related to a set of directives. See [1].
This set is: <Directory>, <Location>, <Files>, <If>, and <Proxy>


However, this directive is explicitly disallowed in <Directory>, <File> and <If> in the code.

So it should work only in <Location> and <Proxy> + (server config and virtual host)


[1]: https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Context
Comment 4 Christophe JAILLET 2020-06-10 19:56:49 UTC
(In reply to mjr from comment #2)
> Thank you for the information.
> 
> Directory context appears to have been added by revision 1731088 but the
> commit message does not clarify it for me.
> 
> https://svn.apache.org/viewvc?view=revision&revision=1731088

xfomrs in the commit in related to xml --> html transformation when building the doc.

The commit related to the real change is r1731081 on 2.4.x and r1653941 on trunk.
Comment 5 mjr 2020-06-10 20:03:46 UTC
Thank you again. If I may beg further indulgence: why is Alias forbidden in <If ...>...</If>?  It really would ease macro-writing if some Alias statements could be conditional on a parameter.