Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I restart mod_python without restarting Apache orforce to reload ?

share|improve this question
How are you serving your python? mod_python, cgi, something else? – Zoredache Aug 5 '10 at 18:27
python (mainly trac) is loaded via mod_python – ralf.w. Aug 5 '10 at 18:46
up vote 3 down vote accepted

mod_python is not a separate program from Apache, it is just some code that runs as part of Apache itself. So you can't restart or reload mod_python without restarting or reloading Apache.

You can get mod_python to automatically reload the main script whenever it changes by putting the directive

PythonAutoReload on

in your Apache configuration.

Note that mod_python is becoming deprecated in favor of mod_wsgi, which does allow you to run Python code as a separate process that can be restarted independently of Apache.

share|improve this answer
PythnAutoReload does NOT result in automatic reloading for arbitrary Python code file changes. It only works for special handler script files managed directly by mod_python. When using Trac, there will be no such handler files being used and so option does nothing. – Graham Dumpleton Aug 5 '10 at 22:49
@Graham: thanks for pointing that out, I edited accordingly. I've been using WSGI for long enough that I've evidently forgotten how mod_python works ;-) – David Z Aug 6 '10 at 2:01
OK, I will give mod_wsgi a try. With the help of both of you, I do accept this as the answer. – ralf.w. Aug 6 '10 at 6:40

Your Answer


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.