python cgi permision error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • avenpace@gmail.com

    #1

    python cgi permision error

    Hi

    I have python cgi script, but when I call it I got server internal
    error. The log in my apache is

    [Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] (13)Permission
    denied: exec of '/srv/www/cgi-bin/helo.cgi' failed
    [Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] Premature end of
    script headers: helo.cgi
    [Sat Mar 18 04:20:09 2006] [notice] caught SIGTERM, shutting down

    I have set the correct permision for the script(755) and the script is
    also own by apache uid.
    I think somehow apache cannot run python to process my python cgi
    script, but I don't know what I should do anymore.
    When I run it via shell, the cgi work fine
    I also can't make my mod_python .py write anything inside my /var/www
    dir although permision already true, even if I gave /var/www permision
    recursively to 777(I know this not good idea, just for testing), still
    have permision denied stuff.
    Btw I'm using SuSE 10, Apache/2.0.54, and python 2.4
    Sighhh, there's a lot of weird thing with my apache and I can't
    understand why :'(

  • David Bear

    #2
    Re: python cgi permision error

    avenpace@gmail. com wrote:
    [color=blue]
    > Hi
    >
    > I have python cgi script, but when I call it I got server internal
    > error. The log in my apache is
    >
    > [Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] (13)Permission
    > denied: exec of '/srv/www/cgi-bin/helo.cgi' failed
    > [Sat Mar 18 04:17:14 2006] [error] [client 127.0.0.1] Premature end of
    > script headers: helo.cgi
    > [Sat Mar 18 04:20:09 2006] [notice] caught SIGTERM, shutting down
    >
    > I have set the correct permision for the script(755) and the script is
    > also own by apache uid.[/color]

    assuming you are running this python script the standard cgi way and not
    through modpython or fastcgi.

    try debugging this way.

    execute the python script from command line as the web user.

    make sure your python script prints the standard

    """Content-type: text/html

    """

    header.
    [color=blue]
    > I think somehow apache cannot run python to process my python cgi
    > script, but I don't know what I should do anymore.
    > When I run it via shell, the cgi work fine
    > I also can't make my mod_python .py write anything inside my /var/www
    > dir although permision already true, even if I gave /var/www permision
    > recursively to 777(I know this not good idea, just for testing), still
    > have permision denied stuff.
    > Btw I'm using SuSE 10, Apache/2.0.54, and python 2.4
    > Sighhh, there's a lot of weird thing with my apache and I can't
    > understand why :'([/color]

    --
    David Bear
    -- let me buy your intellectual property, I want to own your thoughts --

    Comment

    • devilandme@gmail.com

      #3
      Re: python cgi permision error

      >[color=blue]
      > assuming you are running this python script the standard cgi way and not
      > through modpython or fastcgi.[/color]
      yes I'm running it in standard cgi way coz my provider only allow me
      that way.
      And it's really just simple script. Sorry for the dumb question, I know
      modpython but what do you mean by fast cgi
      [color=blue]
      >
      > try debugging this way.
      >
      > execute the python script from command line as the web user.
      >
      > make sure your python script prints the standard
      >
      > """Content-type: text/html
      >
      > """[/color]

      Yess I've done that. I have also run it on windows machine and it work.
      It seem my apache from SuSE 10.0 had some weird error permision that I
      don't understand when running cgi. I'm also had that kinda error if I
      running other cgi on perl or binary cgi :(

      Comment

      • avenpace@gmail.com

        #4
        Re: python cgi permision error

        Sorry accidently replying using my other google account

        devilandme@gmai l.com wrote:[color=blue][color=green]
        > >
        > > assuming you are running this python script the standard cgi way and not
        > > through modpython or fastcgi.[/color]
        > yes I'm running it in standard cgi way coz my provider only allow me
        > that way.[/color]
        And it's really just simple script. Sorry for the dumb question, I know
        modpython but what do you mean by fast cgi[color=blue]
        >[color=green]
        > >
        > > try debugging this way.
        > >
        > > execute the python script from command line as the web user.
        > >
        > > make sure your python script prints the standard
        > >
        > > """Content-type: text/html
        > >
        > > """[/color]
        >[/color]
        Yess I've done that. I have also run it on windows machine and it work.
        It seem my apache from SuSE 10.0 had some weird error permision that I
        don't understand when running cgi. I'm also had that kinda error if I
        running other cgi on perl or binary cgi :(

        Comment

        Working...