The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Python

Discussion in 'General Discussion' started by nibb, May 30, 2008.

  1. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Does someone know a good, easy and safe way to install Python script support with Cpanel?

    It seems python is not a function out of the box.

    :)
     
  2. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Is python installed on the machine ? It must be as cPanel install Python support when it installs itself.. but in case it's corrupt, you can manually install it using "yum install python*" command. This will install Python & all it's required dependencies.. Hope that helps..
     
  3. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    You mean Cpanel supports Python out of the box?

    This is a new server which came with Cpanel im not sure if Python should be working. When i run "whereis python" it goes show python to be there but when y try to run a python script on an account it doesnt work. It just loads the python script instead of executing it. So I supposed maybe it doesnt work out of the box.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    There's a difference between running Python from the command line and running a Python script designed for a website via Apache.

    Typically Python scripts for websites require mod_python, which is not supported at this time.
     
  5. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Ok sorry for that.

    So Cpanel doesnt support it out of the box or you mean or it doesn support it at all and will cause conflicts?

    Becasue i see hosts offering mod python support and they also use Cpanel.

    Thanks
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    We don't support it out of the box and it borders on possibly being outside our realm of support. However, it will work in a cPanel/WHM environment if done properly. In fact, one of our presenters is using mod_python as an example of how to add custom modules via EasyApache 3 at this month's conference.
     
  7. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Thanks, do you know someone I can pay for this?
     
  8. Parcye

    Parcye Well-Known Member

    Joined:
    May 19, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Eindhoven
    Did you ever get this going? I had it all working but somehow can't seem to build apache with mod_python atm. Its not an option :S
     
  9. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    I tried but could not do it. I also did not found any documentation at all about this. I thought people where not using python but some are. There is not much request for it but its always nice to have the option. Im without it for now because nobody seems to be able to do this without breaking the server. So its a risk i cannot take right now.
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You should be able to install mod_python as you would for a normal Apache installation so long as you do it from source and carefully read through and understand how Easyapache will affect it:
    http://www.cpanel.net/support/docs/ea/ea3/index.html

    One thing to be careful of - it's probably not a good idea to change the python version that is installed with cPanel as it could possible cause problems elsewhere. If you need to do that, it might be sensible to install it in a different path (e.g. /opt).

    A much simpler alternative might be to use FastCGI which is supported as a module in Easyapache and run python scripts through that.
     
  11. Parcye

    Parcye Well-Known Member

    Joined:
    May 19, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Eindhoven
    Well the strange thing is, that I had it up and running in the past, via easyapache (I am 95% sure).

    But then it was a mod i could just 'select' and it would go all fine.

    So what has changed?
     
  12. Parcye

    Parcye Well-Known Member

    Joined:
    May 19, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Eindhoven
    I just had a look at my httpd.conf from now and one from before, and the diference is the loadmodule lines.

    The current one is missing:
    LoadModule python_module modules/mod_python.so

    Cannot load /usr/local/apache/modules/mod_python.so into server: /usr/local/apache/modules/mod_python.so: cannot open shared object file: No such file or directory

    So somehow, this module has now gone? Without me knowing about it.
     
  13. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you compiled mod_python manually then you have to store the module outside of /usr/local/apache as easyapache creates the /modules directory anew and only adds back the modules it compiles for the build.
     
  14. Parcye

    Parcye Well-Known Member

    Joined:
    May 19, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Eindhoven
    Further investigation shows me that the mod_python.so is in the apache.backup , /usr/local/apache.backup_archive/20080609.1213007536/modules/ . This gives me the idea that in the past I was able to compile apache with python via easy apache (I was 95% sure, seems to be corrent)
     
  15. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  16. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The existence of a module in the backup is not evidence that you were able to compile the module by means of easyapache. It simply means that at some point, some how, the module was compiled and installed into Apache's standard module directory. The backup is merely a copy of /usr/local/apache, regardless of how the contents were initially created.
     
  17. Parcye

    Parcye Well-Known Member

    Joined:
    May 19, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Eindhoven
    Thank you for clearing that up.

    I have just sent the PDF to copycenter and will look at it later.
     
Loading...

Share This Page