How To Install mod_python For Apache Under cPanel

Article By: tilisha


mod python for Apache VPS To begin, let's grab the latest version of mod_python. We will need to get the SVN version of mod_python as the last previous versioned release has a problem compiling on RHEL5-based systems. Since cPanel servers do not come with Subversion installed by default, we'll need to satisfy that pre-requisite first.

Due to cPanel building Perl modules from source, we will be unable to install Subversion via Yum and must do so from source.

yum -y install neon neon-devel
cd /usr/src/
tar xjvf subversion-1.5.9.tar.bz2
cd subversion-1.5.9 && ./ --with-apr=/usr/local/apache/bin/ --with-apr-util= /usr/local/apache/bin/ --with-ssl --disable-mod-activation
make && make install

Now we can proceed with getting mod_python.

cd /usr/src/ 
svn co
cd mod_python/

Now it is time to configure and build mod_python. Normally we just need to tell mod_python the location of the Apache apxs binary, but if you have additional build requirements, be sure to specify them on the configure line.

. /configure --with-apxs=/usr/local/apache/bin/apxs
make && make install

make install will place the compiled DSO in the appropriate modules/ directory under Apache. All that is left to do is to tell Apache to load it as a DSO module.

Edit/usr/local/apache/conf/includes/pre_main_global.conf and add the following:

# Mod_python (from SVN) support
LoadModule python_module modules/

Finally, restart Apache (/scripts/restartsrv_apache) and then double-check the module is loading OK:

[email protected] [~] # /usr/local/apache/bin/httpd -t -D DUMP_MODULES|grep python
Syntax OK
python_module (shared)

Tags: , , , ,

Welcome to the healthcare-only HIPAA - GDPR compliant cloud. Exclusively hosted on a HPC environment!

Learn more or start today by choosing your secure HIPAA - GDPR compliant server's Operating System bellow and pick the package that's best for you.

BIPmd makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine, thousand or more.

Windows VPS options and add ons
Linux VPS options and add ons


Looking for a custom solution?

Our technicians can provide you with the best custom-made solutionss on the market, no matter whether you're a small business or large enterprise.

Get in touch

Leave a Reply