Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How would i enable and execute python scripts on cPanel/WHM accounts?

share|improve this question

closed as off topic by Chris S Jul 22 '12 at 20:22

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

wow, asked this 1 month ago!!!!!!!, no response!!! –  Daniel Jul 23 '10 at 9:08
3 months ago. still no response :( –  Daniel Oct 1 '10 at 9:18

1 Answer 1

up vote 0 down vote accepted

You can download the mod_python here : wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz

Extract and configure the mod_python: ./configure --with-apxs=/usr/local/apache/bin/apxs make make install

Now you have to add the mod_python module to apache : Locate where is mod_python.so is and then add the module to apache config file (/usr/local/apache/conf/httpd.con) : LoadModule python_module libexec/mod_python.so

Restart apache and you

No you have finished with apache and you should configure the virtual host : go to /home/username/public_html and create a .htaccess file which containing:

AddHandler python-program .py PythonHandler testingpython PythonDebug On

share|improve this answer
This does not help because it does not explain how to add the module to apache without breaking the cpanel-generated files. –  Evgeny Feb 22 '12 at 15:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.