Re: Apache mod_rewrite/mod_proxy conflict?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As I said in my previous post, the suggestion of Neil will work no matter what. No doubt about that.

What surprises me is that you mention that changing the order of the LoadModule directives actually changes the order in which the modules are executed. That does not make sense unless you are using Apache 1.3 (or older).

In 2.x the order in which the modules are executed is determined when the various hook handlers are registered, i.e. during initialisation of httpd. A hook handler can be registered to be executed FIRST, MIDDLE or LAST (there are actually a couple more, but irrelevant here). One can furthermore specify that a hook handler shall be executed before or after the handler for the same hook of a specified module (or list thereof).

All the hook handlers of mod_proxy are registered to be executed FIRST, and on top of that the fixup handler is explicitly registered to be executed before the equivalent handler of mod_rewrite. Most of the handlers of mod_rewrite, including the content handler are registered to be executed MIDDLE, thus AFTER those of mod_rewrite. The fixup handler of mod_proxy is a predecessor of the one of mod_rewrite.

Have a look at mod_rewrite.c and mod_proxy.c. You will find the function register_hooks() at the bottom of each file.

-ascs

-----Message d'origine-----
De : Tamer Embaby [mailto:Tamer.Embaby@xxxxxxxxxx] 
Envoyé : lundi 10 décembre 2007 19:42
À : users@xxxxxxxxxxxxxxxx
Objet : RE: RE:  Apache mod_rewrite/mod_proxy conflict?

Axel,

It's totally my mistake! I didn't mention anything about the environment! (I'm hitting my head against the wall for 12+ hours daily for managing Vignette CMS).  So please forgive me about this.

No it's Apache 2.0.61 (latest) on Solaris 10 U4, and also Linux RHEL 4.4.

The solution that the other gentleman pointed me to (Neil Hillard) worked OK for me, problem solved, but I just need to understand how Apache 2.0 handle module loading and calling order, specifically with mod_rewrite/mod_proxy (the case I pointed below).

Regards,
Tamer

-----Original Message-----
From: Axel-Stephane SMORGRAV [mailto:Axel-Stephane.SMORGRAV@xxxxxxxxxxxxxx]
Sent: Monday, December 10, 2007 8:30 PM
To: users@xxxxxxxxxxxxxxxx
Subject: RE:  Apache mod_rewrite/mod_proxy conflict?

Judging from your problem description, specifically the fact that modifying the ordering of the LoadModule directives changes the behaviour of the server, you must be using Apache 1.3.

>From Apache 2.0 on the order of execution of the various hooks is independent of the order of LoadModule directives. Apache determines the ordering itself.

Had you used Apache 2.0 your ProxyPass directive would have gotten the upper hand on RewriteRule and there would have been nothing you could do about it except from what was suggested to you.

-ascs

-----Message d'origine-----
De : Tamer Embaby [mailto:Tamer.Embaby@xxxxxxxxxx] Envoyé : lundi 10 décembre 2007 16:05 À : users@xxxxxxxxxxxxxxxx Objet : RE:  Apache mod_rewrite/mod_proxy conflict?

Neil,

Thanks for the answer, I will do that.

But still I want to understand the behavior of both modules, who get called first? Where can I read about this?

Thanks for your time.

Tamer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux