apache/mod_wsgi daemon mode

Discussion in 'Python' started by Scott SA, Feb 3, 2008.

  1. Scott SA

    Scott SA Guest

    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
    Scott SA, Feb 3, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Smith

    FW: apache/mod_wsgi daemon mode

    Brian Smith, Feb 3, 2008, in forum: Python
    Replies:
    0
    Views:
    334
    Brian Smith
    Feb 3, 2008
  2. Scott SA

    RE: apache/mod_wsgi daemon mode

    Scott SA, Feb 3, 2008, in forum: Python
    Replies:
    1
    Views:
    1,057
    Graham Dumpleton
    Feb 3, 2008
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    444
    Jean-Paul Calderone
    Mar 20, 2009
  4. wojciech777
    Replies:
    0
    Views:
    493
    wojciech777
    Nov 5, 2011
  5. Gilles
    Replies:
    0
    Views:
    175
    Gilles
    Feb 12, 2013
Loading...

Share This Page