Apache and mod_python on Windows

Just a friendly reminder for myself how to get Apache 2.2 and mod_python 3.3.x working again after I wasted almost five hours trying to get it running again after upgrading from an older version and Apache 2.0.54.

Prerequisites: Install Apache and Python

  • Accquire and compile SVN snapshot of mod_python
  • Install resulting Python package
  • LoadModule python_module modules/mod_python.so in httpd.conf

I was stuck for hours because of this simple problem: mod_python.so is dependant on python24.dll (or any other version, depending on what version of Python mod_python was linked against during compile time), and Apache will report “Cannot find module” instead of “Cannot load dependency” or something if this DLL cannot be found.
This is where adding PathToPython to the global PATH enviroment variable comes into play. If you add it to the local PATH variable instead of the global one, you’ll need to start the Apache service under your Windows account name. (Duh, if I was into masochism I’d bump my head against a wall endlessly for wasting my time like this)

Comments are closed.