#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    5
    Rep Power
    0

    configuring apache for python scripts


    Hi,
    How should I configure my apache server for runnning python scripts. I am able to run perl scripts from my apache server but unable to run python scripts. Please help me out.

    Regards,
    Manish Bhandari
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    Python CGI


    If you can run Perl CGI already it should be pretty easy to use Python too. It's probably the path to Python which is causing the problem. Not knowing where you have Python installed or which platform your using id try #!/usr/bin/env python. on Windows it will find Python where ever you have it installed, on Linux/Unix I believe it searches only the usr/bin directory but in not sure about that. Anyway give it a try.

    Mark
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    5
    Rep Power
    0

    I was able to run the python script


    Hi,
    I was able to run the python script successfully after spending a little more time on the problem. Now if anyone could tell me how to run jython scripts than that wud be really great. Because now I am stuck there. . I know this is not the right platform to post such questions, but I think jython is the logical next step for python application developers.

    I am sure now that I am giving the right path, but the apache server gives an internal server error, every time i try to read a script that specifies the location to jython interpreter. Same file with the location of python interpreter works fine.

    Does apache supports Jython scripts after all?

    Regards,
    Manish
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    Jython and CGI


    Not having used Jython much I wouldnt know about developing in Jython. but if your trying to use Jython for CGI just use, #!/usr/bin/env jython. It works for me.

    for example:

    #!/usr/bin/env jython
    print 'content-type: text/plain\n'
    print 'yo, from jython'

    if your talking about developing applets in Jython, then you dont need to configure apache at all as applets run client side. You'd have to check up on this though. If im wrong let me know!

    Mark

IMN logo majestic logo threadwatch logo seochat tools logo