I'm hosting a Django application on Apache using mod_python. From time to time, I recieve some cryptic mod_python errors, usually from the ImportError variety, while not usually mentioning towards the same module. The truth is, these appear in the future up for any single forked subprocess, as the others operate fine, even if I pressure behavior that needs while using module the problem process has errored on. When the process encounters the mistake, it'll always just serve exactly the same traceback each time Apache selects it to deal with a request. (This is an inconvenience, since my customers don't always report the mistake around the first occurrence, and when the procedure encounters the mistake.)

I understand much more about setting up Django than setting up Apache, but that will not get me anywhere because the request never reaches Django for processing. Ideally, I ought to solve the main problem, which might involve my code, project, or machine configuration, but for now, I want help figuring out and mitigating the issue.

  1. Can there be in whatever way to configure the Apache logs to incorporate a subprocess id?
  2. Can there be in whatever way to pressure a subprocess to respawn whether it has hit a mistake?
  3. What are the known issues relevant for this which i ought to know about?

Like a workaround, and presuming you're liberated to install new Apache modules around the server, you could try among

  • mod_scgi
  • mod_fastcgi
  • mod_wsgi

rather. I personally use SCGI for connecting an nginx frontend webserver to my Django applications, which highlights a significant benefit (decoupling in the webserver). Many of these packages can be found in Debian, most likely on RHELx too.

A far more detailed version of the question with recognized response is offered at this reposting: