A Brief Look at Mod_Python - Installing Mod_Python
(Page 2 of 5 )
First, head on over to the mod_python website:
http://modpython.org
Download the latest version for your platform.
To install mod_python on a Unix enviroment, you perform the usual ritual:
$ ./configure
$ make
$ su
# make install
You may, however, need to help the configure script out a bit by pointing it to apxs (which is included with Apache and is needed to compile mod_python) or Python itself:
$ ./configure -with apxs=/some/strange/place/apxs -with-python=/some/strange/place/apxs
With Windows, things are easier. Although mod_python's official site no longer offers an easy installation option for Windows, a gentleman by the name of Nicolas Lehuen provides one on his website:
http://www.lehuen.com/nicolas
You can download it here:
http://www.lehuen.com/nicolas/download
Install it, and you're almost good to go.
You'll then need to configure Apache (on either platform). Load httpd.conf into your favorite text editor. Add this:
LoadModule python_module libexec/mod_python.so
If you used the Windows installer I mentioned, use this instead:
LoadModule python_module modules/mod_python.so
Failing both of those, try searching for the location of mod_python.
We'll have to set mod_python as the handler for Python files. Add this to httpd.conf:
AddHandler python-program .py
Finally, we must give .htaccess a bit of power. Search httpd.conf for the string "AllowOverride" set it to "All." You should end up with this:
AllowOverride All
Next: Getting Started >>
More Python Articles
More By Peyton McCullough