You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by An...@bmw.de on 2015/02/20 13:33:32 UTC

[users@httpd] Execution order of directives within Apache 2.4

Hello everybody,

I was searching for a description of the exection order of directives and configurations within the apache and I wasn't able to find the documentation about that? E.g. I know that ReverseProxy rules will be executed in the order from top down, also virtual hosts and filters, but I wasn't able to find out what the execution order is if I have e.g. virtual hosts configured and rewrite rules within the main configuration?

Are there general rules, like the overall order inside the httpd.conf, or the execution is based on the order the single corresponding modules are loaded?

Thanks in advance & best regards,
André

Re: [users@httpd] Execution order of directives within Apache 2.4

Posted by Eric Covener <co...@gmail.com>.
On Fri, Feb 20, 2015 at 7:33 AM,  <An...@bmw.de> wrote:
> Are there general rules, like the overall order inside the httpd.conf, or
> the execution is based on the order the single corresponding modules are
> loaded?


Directives are not directly excuted, they supply configuration to many
different modules.

Those modules all run in different stages of Apache processing.  They
can ask early, late, or before or after other modules they know about.
Sometimes, the order is undefined and can change over time.

So there is really no general rule other than how configurations
should be merged other than the precedence of the various
configuration sections:

http://httpd.apache.org/docs/2.4/sections.html

For example, DirectoryIndex specified multiple times might implicitly
add to the list, but using Require implicitly starts over fresh.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


AW: [users@httpd] Execution order of directives within Apache 2.4

Posted by An...@bmw.de.
Yes, you are completely right and all configurations, which are based on executions orders are hackish and I don't try to implement such configurations. There just have been some internal questions about the execution order of configurations inside apache and I was not fully aware of and so I asked.

The information about the sections topic (http://httpd.apache.org/docs/2.4/sections.html), helped me at that point. 

Thanks & cheers,
André

-----Ursprüngliche Nachricht-----
Von: Nick Kew [mailto:nick@webthing.com] 
Gesendet: Freitag, 20. Februar 2015 14:13
An: users@httpd.apache.org
Betreff: Re: [users@httpd] Execution order of directives within Apache 2.4

On Fri, 20 Feb 2015 12:33:32 +0000
<An...@bmw.de> wrote:

> 
> Hello everybody,
> 
> I was searching for a description of the exection order of directives and configurations within the apache and I wasn't able to find the documentation about that? E.g. I know that ReverseProxy rules will be executed in the order from top down, also virtual hosts and filters, but I wasn't able to find out what the execution order is if I have e.g. virtual hosts configured and rewrite rules within the main configuration?
> 
> Are there general rules, like the overall order inside the httpd.conf, or the execution is based on the order the single corresponding modules are loaded?

If that kind of esoterica matters to you, it suggests you're
attempting something very hackish and likely to be hard to
maintain.  Best advice is don't.  Failing that, try it and see.

The specific question you put is described in mod_rewrite documentation
(and note that any use of mod_rewrite hints at the likelihood of a hack
that might easily have been necessary in the 1990s, but has long since
become redundant).  Rewrite directives at top level are indeed processed
early, before context-sensitive config.


-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Execution order of directives within Apache 2.4

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 20 Feb 2015 12:33:32 +0000
<An...@bmw.de> wrote:

> 
> Hello everybody,
> 
> I was searching for a description of the exection order of directives and configurations within the apache and I wasn't able to find the documentation about that? E.g. I know that ReverseProxy rules will be executed in the order from top down, also virtual hosts and filters, but I wasn't able to find out what the execution order is if I have e.g. virtual hosts configured and rewrite rules within the main configuration?
> 
> Are there general rules, like the overall order inside the httpd.conf, or the execution is based on the order the single corresponding modules are loaded?

If that kind of esoterica matters to you, it suggests you're
attempting something very hackish and likely to be hard to
maintain.  Best advice is don't.  Failing that, try it and see.

The specific question you put is described in mod_rewrite documentation
(and note that any use of mod_rewrite hints at the likelihood of a hack
that might easily have been necessary in the 1990s, but has long since
become redundant).  Rewrite directives at top level are indeed processed
early, before context-sensitive config.


-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org