cPanel: Installing Mod_Python on Apache 2

Rate this post

Note: It is preferred to use mod_wsgi instead of mod_python.

If you want to use mod_python in Apache on a cPanel server, you’ll basically need to compile the module manually and load it into the Apache configuration:

yum -y install subversion (IF it’s not already installed)
svn co mod_python
cd mod_python
./configure –with-apxs=/usr/local/apache/bin/apxs
make && make install

This will dump the compiled module into /usr/local/apache/modules, which is a standard location, but EasyApache may remove it when you run it again.  So it’s best to copy it to another location, for example:

mkdir -p /usr/lib64/httpd/modules/
cp /usr/local/apache/modules/ /usr/lib64/httpd/modules/

Create the file /usr/local/apache/conf/includes/mod_python.conf and add the following line:

LoadModule python_module /usr/lib64/httpd/modules/

Then restart Apache.


1 Comment

  1. Pingback: Python on cPanel/WHM - cPanel Forums

Log in