How to manually start and re-start Apache with mod_wsgi powering a password protected Python WSGI app?

Posted by Mahmoud Abdelkader on Server Fault See other posts from Server Fault or by Mahmoud Abdelkader
Published on 2011-03-18T06:42:09Z Indexed on 2011/03/18 8:11 UTC
Read the original article Hit count: 403

Filed under:
|
|
|
|

I'm working on a project where I have to meet some regulatory requirements that require at least 3 out of 5 authorized users to start a backend web service that handles very sensitive information using pre-assigned passwords.

Right now, the prototype has been approved and is running using Python's wsgiref.simple_server(), which I have programmed to manually prompt for the passwords. Now that the prototype has been approved, I have to migrate the web application to a production environment where I will need to run it behind Apache and mod_wsgi.

I have two questions:

  1. Right now, I use a thin Python wrapper around expect to programmatically allow for remote password entry. How do I get Apache to prompt me for a password before starting? Will this have to be in the app.wsgi script that's executed by mod_wsgi? How would that work since Apache daemonizes, and thus, has no stdin!

  2. Will I have to worry about some type of code reload? Apache probably has some maximum number of requests before it kills and restarts another worker process, but, would this require a password prompt as well?

© Server Fault or respective owner

Related posts about apache

Related posts about security