Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Dec 2004
    Posts
    11

    Default Install mod_python

    Hello.
    I want to use python on my server but i do not now how.

    Can someone give me some tip since its a cpanel server and centos.

    Thanks

  2. #2
    Member
    Join Date
    Jun 2006
    Posts
    92

    Post Installation steps for mod_python in cPanel box

    Following are the simple guidelines to install mod_python in cPanel box, running Apache 1.3.x. You need to have Python installed for this to work - most RHEL+cpanel boxes have this installed by default.

    1) Download and extract Python:
    cd /usr/local/src
    wget http://apache.dataphone.se/httpd/mod...hon-2.7.11.tgz
    tar zxvf mod_python-2.7.11.tgz

    2) Configure & install Python
    cd mod_python-2.7.11
    ./configure --with-apxs=/usr/local/apache/bin/apxs (check where your apxs is by typing: locate apxs)
    make
    make install

    3) Configure Apache
    pico -w /usr/local/apache/conf/httpd.conf
    Locate your LoadModule - section by pressing CTRL-W and typing "LoadModule". Add the following line under the others:
    LoadModule python_module libexec/mod_python.so

    Now locate your AddModule - section by pressing CTRL-W and typing "AddModule". Add the following line under the others:
    AddModule mod_python.c

    4) Installation done, now time for testing!
    First go to your public_html directory. Make a test directory for Python by typing:
    mkdir python

    Now open pico and write the following lines:
    AddHandler python-program .py
    PythonHandler testingpython
    PythonDebug On

    save the file as .htaccess.

    Now open up pico again and copy/paste the following lines:

    from mod_python import apache

    def handler(req):
    req.send_http_header()
    req.write("Hello World!")
    return apache.OK

    close and save as testingpython.py.

    Now restart Apache by typing: service httpd restart

    Take your browser to www.mydomain.com/python/testingpython.py and you should see "Hello World!" If you can see this message then you have succesfully installed Python.



  3. #3
    Member
    Join Date
    Apr 2006
    Posts
    85

    Default

    is this the same install for Fedora4?
    EZ Web Solutions
    *coming soon*
    EZ Quality Hosting
    -- making your life EZ on the net...

Similar Threads & Tags
Similar threads

  1. Mod_python
    By Technics in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-14-2009, 04:34 AM
  2. mod_Python
    By cinu in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 06-27-2006, 09:14 AM
  3. How do I install mod_python?
    By AbeFroman in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-24-2004, 11:54 AM
  4. mod_python
    By MikeF12 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-04-2003, 10:57 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube