If you want to install it onto custom directory, for example like /home/you/opt/Python
Get python sources from python.org
Untar it.
./configure --prefix=/home/you/opt/Python --exec-prefix=/home/you/opt/Python --enable-shared
make; make install;
Installing mod_python
Get mod_python from here http://httpd.apache.org/modules/python-download.cgi
Untar it.
./configure --prefix=/home/you/opt/mod_python --exec-prefix=/home/you/opt/mod_python --with-apxs=/home/you/opt/httpd/bin/apxs --with-python=/home/you/opt/Python/bin/python
# because normal 'make install' needs 'su' access,
make; make install_dso; make install_py_lib
add below configurations into httpd.conf
LoadModule python_module modules/mod_python.soRestart httpd. It'll works.
<Directory [absolute path]>
AddHandler mod_python .py
PythonHandler test
PythonDebug On
</Directory>
No comments:
Post a Comment