Errors running cgi program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike S. Nowostawsky

    Errors running cgi program

    I am getting this error when I try to run a program in my cgi-bin directory
    (don't know what I'm still missing to make it work):

    ***
    Authentication required!

    This server could not verify that you are authorized to access the URL
    "/~group3/cgi-bin/ack.cgi". You either supplied the wrong credentials (e.g.,
    bad password), or your browser doesn't understand how to supply the
    credentials required.

    In case you are allowed to request the document, please check your user-id
    and password and try again.

    If you think this is a server error, please contact the webmaster

    Error 401
    ***

    --

    As far as I know, I have the correct entries in my http.conf file and have
    created a .htaccess file and a .htpasswd file for access requirements (and
    both the directories and programs are allowing read/execute access to
    'other').

    When I run the program from an html page (from a submit button) I get a
    popup window asking me to enter an ID and password (btw is this window
    supposed to come up? I thought the .htpasswd file was supposed to allow for
    the apache user id to have access to programs in cgi-bin?). If I enter an
    entry in the .htpasswd file it just the window continues to popup
    indefinitely... if I cancel the window, then I get the 'Authentication
    required!' error (details below).

    ALSO, if I remove the .htaccess file from the cgi-bin dir I get these errors
    (followed by the log errors):

    ***
    Server error!

    The server encountered an internal error and was unable to complete your
    request.

    Error message:
    Premature end of script headers: ack.cgi

    If you think this is a server error, please contact the webmaster

    Error 500

    ---

    suexec.log:
    [2004-02-19 17:59:50]: uid: (501/group3) gid: (501/501) cmd: ack.cgi
    [2004-02-19 17:59:50]: target uid/gid (501/501) mismatch with directory
    (0/0) or program (0/0)
    ***

    ---
    ---

    OTHER DETAILS:

    ..htaccess contents (in dir with CGI programs):
    ----------------------------------------------
    AuthType Basic
    AuthUserFile /home/group3/.htpasswd
    AuthName "Secret"
    require valid-user


    ..httpd.conf contents (re: the dir I have my cgi-bin programs in):
    -----------------------------------------------------------------
    #~added for group3 project
    <Directory "/home/*/public_html/cgi-bin">
    AllowOverride All
    Options Includes ExecCGI
    Order allow,deny
    Allow from all
    </Directory>
    <Directory "/home/group3/public_html/cgi-bin">
    AllowOverride All
    Options +ExecCGI
    </Directory>

    <Directory "/home/*/public_html">
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    #~~


    ---
    ---


    Any idea what might still be missing in my setup?

    Thx,


    _______________ ___
    l8r,
    M.


  • Mike S. Nowostawsky

    #2
    Re: Errors running cgi program

    Well, I tried copying everything to my main apache cgi-bin directory and
    from there the programs DO run (so this has to be a setup problem in the
    conf file or with htaccess or perhaps something else when it comes to the
    /home/group3 /cgi-bin for a particular user setup). Still wondering what's
    not complete there?

    --

    Now, regarding running it from the main cgi-bin, the problem
    I'm having there is accessing the PostGres database. I think I've setup the
    correct user access to the database (I've added the group3 and apache users
    to it) BUT when I try to open it I get a
    "Internal error in server: could not access database"
    error. Any idea why I might be missing to allow access to it? PostGres IS
    running as a service.

    My code to access the DB is:
    ***
    PgDatabase conn ("host=localhos t dbname=group3") ;
    if ( conn.Connection Bad() )
    {
    HTMLstream reply;
    reply << "Internal error in server: could not access
    database";
    reply.send();
    }
    else
    ....
    ***


    Thx for any suggestions!

    --

    =============== =============== =============== ==
    Mike S. Nowostawsky:
    Email: mikenowo@sympat ico.ca, mikenowo@yahoo. ca
    Home Page: http://www3.sympatico.ca/mikenowo/
    Lachine (Montreal), Quebec, Canada

    "Mike S. Nowostawsky" <mikenowo@sympa tico.ca> wrote in message
    news:nZrZb.1576 7$d34.1575432@n ews20.bellgloba l.com...[color=blue]
    > I am getting this error when I try to run a program in my cgi-bin[/color]
    directory[color=blue]
    > (don't know what I'm still missing to make it work):
    >
    > ***
    > Authentication required!
    >
    > This server could not verify that you are authorized to access the URL
    > "/~group3/cgi-bin/ack.cgi". You either supplied the wrong credentials[/color]
    (e.g.,[color=blue]
    > bad password), or your browser doesn't understand how to supply the
    > credentials required.
    >
    > In case you are allowed to request the document, please check your user-id
    > and password and try again.
    >
    > If you think this is a server error, please contact the webmaster
    >
    > Error 401
    > ***
    >
    > --
    >
    > As far as I know, I have the correct entries in my http.conf file and have
    > created a .htaccess file and a .htpasswd file for access requirements (and
    > both the directories and programs are allowing read/execute access to
    > 'other').
    >
    > When I run the program from an html page (from a submit button) I get a
    > popup window asking me to enter an ID and password (btw is this window
    > supposed to come up? I thought the .htpasswd file was supposed to allow[/color]
    for[color=blue]
    > the apache user id to have access to programs in cgi-bin?). If I enter an
    > entry in the .htpasswd file it just the window continues to popup
    > indefinitely... if I cancel the window, then I get the 'Authentication
    > required!' error (details below).
    >
    > ALSO, if I remove the .htaccess file from the cgi-bin dir I get these[/color]
    errors[color=blue]
    > (followed by the log errors):
    >
    > ***
    > Server error!
    >
    > The server encountered an internal error and was unable to complete your
    > request.
    >
    > Error message:
    > Premature end of script headers: ack.cgi
    >
    > If you think this is a server error, please contact the webmaster
    >
    > Error 500
    >
    > ---
    >
    > suexec.log:
    > [2004-02-19 17:59:50]: uid: (501/group3) gid: (501/501) cmd: ack.cgi
    > [2004-02-19 17:59:50]: target uid/gid (501/501) mismatch with directory
    > (0/0) or program (0/0)
    > ***
    >
    > ---
    > ---
    >
    > OTHER DETAILS:
    >
    > .htaccess contents (in dir with CGI programs):
    > ----------------------------------------------
    > AuthType Basic
    > AuthUserFile /home/group3/.htpasswd
    > AuthName "Secret"
    > require valid-user
    >
    >
    > .httpd.conf contents (re: the dir I have my cgi-bin programs in):
    > -----------------------------------------------------------------
    > #~added for group3 project
    > <Directory "/home/*/public_html/cgi-bin">
    > AllowOverride All
    > Options Includes ExecCGI
    > Order allow,deny
    > Allow from all
    > </Directory>
    > <Directory "/home/group3/public_html/cgi-bin">
    > AllowOverride All
    > Options +ExecCGI
    > </Directory>
    >
    > <Directory "/home/*/public_html">
    > AllowOverride All
    > Order allow,deny
    > Allow from all
    > </Directory>
    > #~~
    >
    >
    > ---
    > ---
    >
    >
    > Any idea what might still be missing in my setup?
    >
    > Thx,
    >
    >
    > _______________ ___
    > l8r,
    > M.
    >
    >
    >[/color]



    Comment

    Working...