mod_wsgi 2.2 seems to be breaking CGI

6 views
Skip to first unread message

Douglas Thrift

unread,
Aug 23, 2008, 3:39:42 AM8/23/08
to mod...@googlegroups.com
Hello,

This is really strange, but after upgrading from 2.1 I was looking at my
website and noticed that all of my CGI scripts were returning 500 errors and
in the log it was just saying "Premature end of script headers" while
running the scripts in the shell everything was working fine.

I disabled mod_wsgi and restarted Apache and CGI scripts worked again. So I
downgraded back to 2.1 and reenabled mod_wsgi and everything was happy
again.
_______________________________________________________________________
Douglas William Thrift
<dougl...@gmail.com>
<http://www.douglasthrift.net>

Graham Dumpleton

unread,
Aug 23, 2008, 6:57:28 AM8/23/08
to mod...@googlegroups.com
Are you using mod_cgi or mod_cgid?

Graham

2008/8/23 Douglas Thrift <dougl...@gmail.com>:

Douglas Thrift

unread,
Aug 23, 2008, 7:17:38 AM8/23/08
to mod...@googlegroups.com
mod_cgi

_______________________________________________________________________
Douglas William Thrift
<dougl...@gmail.com>
<http://www.douglasthrift.net>

Graham Dumpleton

unread,
Aug 23, 2008, 8:22:31 AM8/23/08
to mod...@googlegroups.com
Right now I cant see how mod_wsgi 2.2 changes could be affecting CGI
scripts, so please excuse me asking a few more stupid questions.

1. What language are the CGI scripts that are failing written in?

2. What is the Apache configuration snippet being used to enable
execution of those CGI scripts?

3. What is the Apache configuration snippet being used to enable WSGI
application?

4. Is mod_python being loaded at the same time?

Graham Dumpleton

unread,
Aug 23, 2008, 9:22:08 AM8/23/08
to mod...@googlegroups.com
Okay, confirmed on MacOS X 10.5.

It only happens when WSGIDaemonProcess directive used with mod_wsgi.

Patch is:

Index: mod_wsgi.c
===================================================================
--- mod_wsgi.c (revision 1001)
+++ mod_wsgi.c (working copy)
@@ -8873,7 +8873,8 @@
* up properly on a restart and on shutdown.
*/

- apr_pool_cleanup_register(p, entry, wsgi_cleanup_process, NULL);
+ apr_pool_cleanup_register(p, entry, wsgi_cleanup_process,
+ apr_pool_cleanup_null);

/*
* If there is more than one daemon process in the group

I guess a mod_wsgi 2.3 will be in order, but need to also fix
setprocttitle() call first as well. :-)

Graham

2008/8/23 Graham Dumpleton <graham.d...@gmail.com>:

Graham Dumpleton

unread,
Aug 23, 2008, 9:49:09 AM8/23/08
to mod...@googlegroups.com
Released version 2.3 to fix this.

2008/8/23 Graham Dumpleton <graham.d...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages