httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wilson <and...@www.elsevier.co.uk>
Subject Redirection and logging...
Date Thu, 30 Mar 1995 17:28:41 GMT

Here's me rabbiting on about log file and redirection problems again.

Under what circumstances *should* the access_log contain a status entry of '-',
as opposed to '200', '302', '500' etc.  Is there any reason why a successful
access should produce other than the normal 'nnn' status?  (ie. the server didn't
explode, or time-out, or suffer net-death) 

To see this weirdness for pure apache 0.3 put the following script in cgi-bin
and watch the access log.

/cgi-bin/redirect:
--- cut here ---

#!/usr/local/bin/perl

( $URL ) = @ARGV;

print "Location: $URL\n\n";

--- cut here ---

Try the following URLs, number 3's the real killer.


1)	http://your.server/cgi-bin/redirect?/

	Produces one entry, status 200.  But what's really happened is that
	the first access called the script, and the script prepared a redirection
	to the same server. The server read the header which the script produced,
	and saw the 'Location:' field, and *then* sent the /index.html file's
	contents.  All this to save the browser coming back a second later
	and asking for index.html explicitly.

	This behaviour is generally fine by me, but the access_log is confusing.
	can we think of a way to record the fact that the contents of index.html
	were sent.  Perhaps we can munge a matching error_log entry.

	This is important because the script and it's ?parameters wouldn't
	necessarily indicate which file was sent back.  I want to see
	notification of where the script got its data, and short of having the
	script keep its own log file I can't think of an easy solution.


2)	http://your.server/cgi-bin/redirect?/cgi-bin/test-cgi

	Same as for (1), but this time the test-cgi script is run immediately
	after the redirect script.


3)	http://your.server/cgi-bin/redirect?http://your.server/

	Produces 2 log entries.  The initial access gives status '-', should
	be 302.  The second entry, the redirected URL, is ok.


4)	http://your.server/cgi-bin/redirect?test-cgi

	Produces 1 log entry, status '-'.  The browser complains that it can't
	locate the host (I presume it's looking for some host called test-cgi).
	Shouldn't this redirect onto another script in the same directory as
	'redirect'?  ie: http://your.server/cgi-bin/test-cgi.  Or are we unable
	to specify redirection to 'relative' resources.  We can redirect to
	another host (full URL), or the same host (full URL, or absolute path
	'/whatever')


I've the eerie feeling that some of this was covered before in our discussions
last week, when I wasn't really paying attention.  Patch B18 treads all over the
same code which causes me these problems.  Let me know if I'm retreading old
ground.

Cheers,
Ay.

     Andrew Wilson	     URL: http://www.cm.cf.ac.uk/User/Andrew.Wilson/
Elsevier Science, Oxford   Office: +44 0865 843155     Mobile: +44 0589 616144


Mime
View raw message