I have since created a minimal Quixote application that reproduces the
problem. So I then interposed the suggested logging middleware and got
the log below. As can be seen, there is a response header "Status"
with a value of "403" (set by Quixote's http_response.set_header
method), but this doesn't seem to have been translated into the
mod_wsgi's own Status value , which is set to 200.

Hamish

[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191] ('REQUEST',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
{'DOCUMENT_ROOT': '***',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'GATEWAY_INTERFACE': 'CGI/1.1',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_ACCEPT_CHARSET': 'UTF-8,*',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_CONNECTION': 'keep-alive',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_COOKIE': '***',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_HOST': 'portal.st-andrews.ac.uk',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_KEEP_ALIVE': '300',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-
US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'LD_LIBRARY_PATH': '/lib:/usr/lib:/usr/local/lib:/usr/local/ssl/lib:/
usr/sfw/lib:/usr/ccs/lib:/usr/local/oracle/fullclient/lib32',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'ORACLE_HOME': '/usr/local/oracle/fullclient',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]   'PATH': '/
usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb/bin:/opt/local/bin:/usr/local/
bin',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'PATH_INFO': '/',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'PATH_TRANSLATED': '/services/web/htdocs/',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'QUERY_STRING': '',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'REMOTE_ADDR': '138.251.61.191',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'REMOTE_PORT': '60801',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'REQUEST_METHOD': 'GET',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'REQUEST_URI': '/test-403/',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SCRIPT_FILENAME': '/services/web/wsgi/test-403.wsgi',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SCRIPT_NAME': '/test-403',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SCRIPT_URI': 'https://portal.st-andrews.ac.uk/test-403/',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SCRIPT_URL': '/test-403/',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_ADDR': '138.251.66.139',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_ADMIN': '***',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_NAME': 'portal.st-andrews.ac.uk',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_PORT': '443',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_PROTOCOL': 'HTTP/1.1',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_SIGNATURE': '',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'SERVER_SOFTWARE': 'Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8g
PHP/5.2.8 mod_wsgi/2.1-BRANCH Python/2.5.2',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.application_group': 'portal.st-andrews.ac.uk|/test-403',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.callable_object': 'application',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.listener_host': '0.0.0.0',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.listener_port': '80',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.process_group': '',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.reload_mechanism': '0',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'mod_wsgi.script_reloading': '1',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.errors': <mod_wsgi.Log object at 0x1db8c98>,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter
object at 0x2266c80>,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.input': <mod_wsgi.Input object at 0x225eb60>,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.multiprocess': True,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.multithread': False,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.run_once': False,
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.url_scheme': 'http',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
'wsgi.version': (1, 0)})
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
('RESPONSE',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]  '200 OK',
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
[('Status', '403'),
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]   ('Date',
'Mon, 14 Sep 2009 16:45:46 GMT'),
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]
('Expires', '-1'),
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]   ('Content-
Type', 'text/html; charset=iso-8859-1'),
[Mon Sep 14 17:45:46 2009] [error] [client 138.251.61.191]   ('Content-
Length', '5')])


On Aug 22, 12:20 am, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> Use the first logging middleware sample in:
>
>  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Re...
>
> to capture the actual response status and headers in Apache error log
> to confirm what Quixote is actually returning.
>
> Also look at your Apache installation to see if if defines any
> ErrorDocument directives related to the status codes you are trying to
> return.
>
> BTW, mod_wsgi 2.1 is quite old now.
>
> Graham
>
> 2009/8/22 Hamish Lawson <hamish.law...@gmail.com>:
>
>
>
> > We have a Quixote application that is intended to return a403status
> > code under certain circumstances. While this is what happens on our
> > development web server, on our production web server we get a 200 code
> > instead of the expected 402. Since one of the main differences between
> > the production and development servers is that the production one is
> > using mod_wsgi, is it possible that mod_wsgi might be somehow changing
> > the issued403code to a 200? Here are fuller descriptions of the
> > respective setups:
>
> > PRODUCTION
>
> > Apache 2.2.11
> > mod_wsgi 2.1
> > Quixote 2.4
> > Python 2.5.2
> > Solaris 10
>
> > DEVELOPMENT
>
> > Apache 1.3.27
> > SCGI 1.12
> > Quixote 2.4
> > Python 2.4.2
> > Solaris 10
>
> > Thanks,
> > Hamish Lawson
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to 
modwsgi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to