apache/mod_wsgi daemon mode

S

Scott SA

HI,

I'm posting this here because it is, I believe, a python config issue (mine) that is not correct, but frustration and inexperience has left me without further [visible] options for rectification.

I am trying to configure mod_wsgi to run in daemon mode with Apache. I can easily get it to run 'normally' under Apache but I obtain permission errors _or_ process-failures in daemon mode. Specifically:

... (13)Permission denied: mod_wsgi (pid=26962): Unable to connect
to WSGI daemon process '<process-name>' on
'/etc/httpd/logs/wsgi.26957.0.1.sock' after multiple attempts.


My httpd.conf contains an entry like this, and has had several variations:

<VirtualHost host.domain.com:80>
ServerName host.domain.com

WSGIDaemonProcess <process-name> user=<user> group=<group> threads=10 \
maximum-requests=500

# the following line has been added/removed with no improved results
WSGIProcessGroup <process-name>

WSGIScriptAlias /something /path/to/<script>.wsgi

<Directory /path/to/<script>.wsgi>
# the following two lines have been added/removed
#with no improved results
WSGIApplicationGroup <user>
WSGIProcessGroup <process-name>

Order deny,allow
Allow from all
</Directory>

...
</VirtualHost>


My <script>.wsgi is as follows - but we never get this far!:

import os, sys
sys.stdout = sys.stderr

# in this instance, I've been testing with a trac instance
os.environ['TRAC_ENV'] = '/path/to/trac'

import trac.web.main
application = trac.web.main.dispatch_request



I have made changes in a number of combinations, trying to pinpoint where the problem is occurring. If I don't attempt to run this as a daemon, all is fine. I have noted where I have added/removed the ProcessGroup adn ApplicationGroup directives in an attempt to find the root of problem.

The host is Apache 2.2n under CentOS 5.1 i386 running Python 2.4

I have read, and re-read, mimicked settings from the following sites:

http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives

as well as several excelent postings from Graham Dumpleton

So, if you listen close enough, you will hear the sound of my head banging against an unforgiving brick wall ;-)

Thanks in advance to any and all relevent advice or suggestions.

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top