By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,302 Members | 1,232 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,302 IT Pros & Developers. It's quick & easy.

Errors running cgi program

P: n/a
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.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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=localhost dbname=group3");
if ( conn.ConnectionBad() )
{
HTMLstream reply;
reply << "Internal error in server: could not access
database";
reply.send();
}
else
....
***
Thx for any suggestions!

--

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

"Mike S. Nowostawsky" <mi******@sympatico.ca> wrote in message
news:nZ*********************@news20.bellglobal.com ...
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.


Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.