Using an action directive from the mod_actions module in Apache httpd
2.2.4 installations seems to cause two actions rather than just the
expected one. In the rewrite log with a log level of 9, there is a
report of a second redirection to a path composed of the action path
concatenated with the original path (all relative to the document root).
When redirection is also in effect, this can cause many extra
redirection requests to appear in the rewrite log. I have not attempted
to check the behaviour in earlier httpd versions.
I can find no reference to this in the FAQ, by search engine on the web
or directly in the mail archives. I have reduced the installation and
configuration to the simplest I can, and the effect is unchanged. There
is a detailed report of this below. For simplicity, only text files were
used in the test. The test action is thus equivalent to a simple
internal rewrite.
I am using Mac OSX, so I have to compile my own binaries. Is my
compilation wrong in some way?
If not, is the extra redirection useful in some way I have not understood?
Is there a way to prevent the extra redirection?
TEST DETAILS
---
Purpose of test
Discover what redirections occur when a very simple mod_actions action
is used in a minimal installation.
---
Conclusion
One unexpected redirection occurred after the expected behaviour.
It appears to be redundant.
It has no apparent effect on the content of responses.
It appears to cause inefficiency
The unexpected redirection's target can exist only if the action is
itself redirected.
---
Server
G4 PowerPC Mac
OSX 10.4.9
Xcode Version 2.2.1
(The same behaviour occurs with Version 2.4.1).
libtool version "Apple Computer, Inc. version cctools-590.23.2" *
(The same behaviour occurs with cctools-622.5) *
IP address 192.168.1.2
* libtool seems to be be irrelevant; 2.2.4 is an official Apache httpd
release.
---
Client
/etc/hosts contains the line
192.168.1.2 example.com
---
Apache expansion, compilation, and accommodation (on the test http server)
tar xvf httpd-2.2.4.tar
cd httpd-2.2.4
./configure --prefix=/opt/apache2 \
--disable-alias \
--disable-asis \
--disable-auth \
--disable-autoindex \
--disable-access \
--disable-cgi \
--disable-dir \
--disable-env \
--disable-imagemap \
--disable-negotiation \
--disable-status \
--disable-userdir \
--enable-rewrite
make
sudo make install
sudo mkdir /private/var/log/httpd_example
---
Web documents (all in the document root
/Library/WebServerExample/Documents/)
alternative (with content "Alternative text")
direct (with content "Directly accessed")
favicon.ico (with no contents)
original.alternate (with contents "Original text")
---
config file changes
DocumentRoot "/Library/WebServerExample/Documents"
#DocumentRoot "/opt/apache2/htdocs"
<Directory "/Library/WebServerExample/Documents">
#<Directory "/opt/apache2/htdocs">
ErrorLog /private/var/log/httpd_example/error_log
#ErrorLog logs/error_log
CustomLog /private/var/log/httpd_example/access_log common
#CustomLog logs/access_log common
#ScriptAlias /cgi-bin/ "/opt/apache2/cgi-bin/"
#<Directory "/opt/apache2/cgi-bin">
#AllowOverride None
#Options None
#Order allow,deny
#Allow from all
#</Directory>
# Rules under test...
AddHandler alt .alternate
Action alt /alternative
RewriteLog "/private/var/log/httpd_example/rewrite_log"
RewriteEngine On
RewriteLogLevel 9
---
Stimuli and responses
Using Safari, requested, each in a fresh window, two URLs...
http://example.com/direct returned "Directly accessed"
http://example.com/original.alternate returned "Alternative text"
---
Error log
[Wed Apr 11 11:05:01 2007] [notice] Apache/2.2.4 (Unix) configured --
resuming normal operations
---
Access log
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100] "GET /direct HTTP/1.1" 200 19
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100] "GET /favicon.ico HTTP/1.1"
200 2
192.168.1.2 - - [11/Apr/2007:11:14:22 +0100] "GET /original.alternate
HTTP/1.1" 200 18
---
Rewrite log
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (2) init rewrite engine
with requested uri /direct
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (1) pass through /direct
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (2) init rewrite engine
with requested uri /favicon.ico
192.168.1.2 - - [11/Apr/2007:11:09:19 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (1) pass through /favicon.ico
192.168.1.2 - - [11/Apr/2007:11:14:22 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (2) init rewrite engine
with requested uri /original.alternate
192.168.1.2 - - [11/Apr/2007:11:14:22 +0100]
[example.com/sid#180ad98][rid#189ea50/initial] (1) pass through
/original.alternate
192.168.1.2 - - [11/Apr/2007:11:14:22 +0100]
[example.com/sid#180ad98][rid#18a0490/initial/redir#1] (2) init rewrite
engine with requested uri /alternative/original.alternate
192.168.1.2 - - [11/Apr/2007:11:14:22 +0100]
[example.com/sid#180ad98][rid#18a0490/initial/redir#1] (1) pass through
/alternative/original.alternate
---
---------------------------------------------------------------------
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: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]