Apache not responding with mod_wsgi in daemon mode

847 views
Skip to first unread message

janedenone

unread,
Jan 21, 2010, 3:40:33 PM1/21/10
to modwsgi
Hello,

I tested mod_wsgi on my local system (OS X 10.6), and then installed
the module on a virtual machine running Cent OS 5. Everything went
fine, but the server (Apache/prefork MPM) does not reply when mod_wsgi
is used in daemon mode. There is no error listed in /var/log/httpd/
error_log - the connection just times out.

I did read about the potential issue with UNIX sockets, and added /var/
run/wsgi as my WSGISocketPrefix, so the socket is created correctly.

In embedded mode, mod_wsgi works fine, but as soon as I uncomment the
following

# WSGIDaemonProcess djangoproject user=apache group=apache threads=10
# WSGIProcessGroup djangoproject

nothing happens. What could cause this issue?

Thanks,
Jan

Graham Dumpleton

unread,
Jan 21, 2010, 5:16:01 PM1/21/10
to mod...@googlegroups.com
After about five minutes (value of Timeout in Apache configuration),
do you see a message in the Apache error logs about:

Script timed out before returning headers: saweb.wsgi

or:

Premature end of script headers

If you do, you may be getting affected by an issue also being seen on
FreeBSD in daemon mode for mod_wsgi 3.X.

Also look for any other error messages about 60 seconds or 5 minutes later.

May be helpful to ensure you have:

LogLevel info

or higher, eg., 'debug', set in Apache configuration. Look in both
virtual host and main Apache error logs.

First off though, tell me whether problem occurs with a simple WSGI
hello world program, ie., don't use a Python web framework or large
application.

If still occurs, then use mod_wsgi 2.8 instead for now.

Am investigating the existing known issue, but don't have huge amount
of time and was only affecting FreeBSD and know that can use mod_wsgi
2.8 instead. This doesn't mean it isn't a serious issue, but just too
overwhelmed with other personal and work stuff at moment to give it my
proper attention.

Graham

2010/1/22 janedenone <janed...@googlemail.com>:

> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>

Pawel Tyll

unread,
Jan 21, 2010, 5:21:22 PM1/21/10
to modwsgi
On Jan 21, 9:40 pm, janedenone <janeden...@googlemail.com> wrote:
> In embedded mode, mod_wsgi works fine, but as soon as I uncomment the
> following
> # WSGIDaemonProcess djangoproject user=apache group=apache threads=10
> # WSGIProcessGroup djangoproject
> nothing happens. What could cause this issue?
You really should take a look at few-days old thread:
http://groups.google.com/group/modwsgi/t/51a4e3bbb9ed7ecc

OSX is derived from FreeBSD, and there's some incompatibility with
FreeBSD that's being looked at by Graham Dumpleton at this time.
To sum it up: it's a known problem, and temporary workaround is using
mod_wsgi 2.8 if it's suitable for you.

Graham Dumpleton

unread,
Jan 22, 2010, 1:14:28 AM1/22/10
to mod...@googlegroups.com
2010/1/22 Pawel Tyll <of...@ofca.pl>:


He isn't running under OS X though, he is running on CentOS within a
VM. Thus what OS X is built on doesn't matter.

Personally I develop mod_wsgi on MacOS X and that is what it is tested
on, I haven't seen the FreeBSD problem on MacOS X.

Graham

Graham Dumpleton

unread,
Jan 22, 2010, 6:00:21 AM1/22/10
to mod...@googlegroups.com
BTW, are you by chance also loading mod_python into the same Apache.
If you are then disable it and do a full stop and start of Apache. The
mod_python module can cause various conflicts, including causing
daemon mode to not work in some rare cases.

Graham

2010/1/22 Graham Dumpleton <graham.d...@gmail.com>:

janedenone

unread,
Jan 22, 2010, 7:03:51 AM1/22/10
to modwsgi
On Jan 22, 12:00 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:

> BTW, are you by chance also loading mod_python into the same Apache.
> If you are then disable it and do a full stop and start of Apache. The
> mod_python module can cause various conflicts, including causing
> daemon mode to not work in some rare cases.

That's exactly what happened (I found a relevant thread *after*
posting, sorry - http://groups.google.com/group/modwsgi/msg/9d29b81bc7297e72).

I do load mod_python next to mod_wsgi, but I also did that on my local
machine OS X/FreeBSD, and no problem occurred. That's why I did not
think about disabling mod_python first. On OS X, I can access
different app1 (using mod_python) and app2 (using mod_wsgi) in
parallel.

Anyway: I know what causes the error now, and will disable mod_python
for all apps running on my server.

Many thanks for your help and for mod_wsgi in general,
Jan

Graham Dumpleton

unread,
Jan 22, 2010, 3:12:19 PM1/22/10
to mod...@googlegroups.com
2010/1/22 janedenone <janed...@googlemail.com>:

Alternatively you ensure that mod_python is built/linked against same
Python version and that in linking Python it is using a shared
library. See:

http://code.google.com/p/modwsgi/wiki/InstallationIssues

Graham

Reply all
Reply to author
Forward
0 new messages