To install mod_python, we need the EPEL repositories:
1 | rpm -- import https://fedoraproject.org/static/0608B895.txt |
2 | wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm |
3 | rpm -ivh epel-release-6-7.noarch.rpm |
4 | yum install yum-priorities |
Now edit the
/etc/yum.repos.d/eped.repo file and add
priority=10 to the
[epel] section.
After that follow the steps below and you’ll have mod_python installed and active.
Now you should configure your httpd.conf files so that apache nows
where and when to interpret your Python scripts. If you have installed
you system with our LAMP installer, then go to
/etc/httpd/conf.d and edit you websites
.conf file (starting with a
z_)
1 | vi /etc/httpd/conf.d/z_castmator.com |
Make sure you add the following lines in the
<Directory …> </Directory> statements.
1 | AddHandler mod_python .py |
2 | PythonHandler mod_python.publisher |
Don’t forget that PythonDebug is for debug mode. When you’re done developing it may be a good idea to turn it off.
Also don’t forget to add your DirectoryIndex handlers so that Apache
knows you can also have Python Index files. You can add this right after
the
</Directory> statement.
1 | DirectoryIndex index.html index.php index.py |
Since we’ve altered with the configuration files of Apache, we should restart it again, then you are ready to go.
No comments:
Post a Comment