1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

getting python for a file without .py

Discussion in 'Plesk for Linux - 8.x and Older' started by k.satirli, Aug 12, 2005.

  1. k.satirli

    k.satirli Guest

    0
     
    Basically, I've got a python script and I managed to get it to work with script.PY and script.CGI

    what I want to have is that the script also works without an extension.

    basically like so: "script" is interpreted as python code.

    I've been able to get this to run on cPanel servers without a problem, but I've got no clue what I'm doing wrong.

    here's what I got in the vhost.conf:

    Code:
    <Directory /home/httpd/vhosts/domain.com/httpdocs> 
    <Files "script"> 
    SetHandler python-program 
    PythonHandler mod_python.cgihandler 
    </Files> 
    </Directory> 
    
    I did execute "/usr/local/psa/admin/sbin/websrvmng -a -v " after updating the vhost.conf but all I get when I access the file is a 404. Nothing is mentioned in the log file.

    Any ideas?
     
  2. k.satirli

    k.satirli Guest

    0
     
    hah... I found it.

    Code:
    <Files "script">
    SetHandler python-program 
    PythonPath "['/usr/lib/python2.3','/home/httpd/vhosts/domain.com/misc_stuff']+sys.path"
    PythonHandler MoinMoin.request::RequestModPy.run 
    </Files> 
    
    works fine. now the file named "script" in the root works as expected.

    no error on Plesk's / my side after all, but just too little configuration...
     
  3. Spyder

    Spyder Regular Pleskian

    25
    40%
    Joined:
    Jan 13, 2003
    Messages:
    155
    Likes Received:
    0
    i some place in this forum I post one " pseudo guide" to set up ZOPE (and install other pyton) independent from plesk instaled... search for zope and freebsd..
     
  4. k.satirli

    k.satirli Guest

    0
     
    thanks but I don't have any need for it as my solution works out nicely for me.
     
Loading...