Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Ubuntu 10.04 server that already has apache and wsgi working. I also have a python script that works just fine using the make_server command:

if __name__ == '__main__':
from wsgiref.simple_server import make_server
srv = make_server('', 8080, display_status)
srv.serve_forever()

Now I would like to have the page always active without having to run the script manually. I looked at what Moin is doing. I found these lines in apache2.conf:

WSGIScriptAlias /wiki /usr/local/share/moin/moin.wsgi
WSGIDaemonProcess moin user=www-data group=www-data processes=5 threads=10 maximum-requests=1000 umask=0007
WSGIProcessGroup moin

And moin.wsgi is as listed:

import sys, os

sys.path.insert(0, '/usr/local/share/moin')
from MoinMoin.web.serving import make_application
application = make_application(shared=True)

QUESTION: Can I create a similar section in apache2.conf pointing to another wsgi file? Like this:

WSGIScriptAlias /status /mypath/status.wsgi
WSGIDaemonProcess status user=www-data group=www-data processes=5 threads=10 maximum-requests=1000 umask=0007
WSGIProcessGroup status

And if so, what is required to convert my simple_server script into a daemonized process? Most of the information I find about wsgi is related to using it with frameworks like Django. I haven't found a simple howto detailing how to make this work.

Thanks.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Did you read any of the official mod_wsgi documentation?

share|improve this answer
    
Perfect. Exactly what I was looking for. Thanks, Graham. –  jbbarnes Oct 24 '12 at 23:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.