You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ken Causey <ke...@ineffable.com> on 2002/09/17 16:23:20 UTC

[users@httpd] RE: User cgi-bin doesn't work with 1.3.26, I'm stumped.

Boyle Owen wrote:

> Your system CGI works via the ScriptAlias directive. You have no such
> directive for the user directories. However, you do have an "AddHandler
> cgi-script .cgi" which will cover those (although it is inside an
> <IfModule mod_mime.c> container - I presume you have this module loaded?).

Yes, you will note that there is an appropriate LoadModule statement for 
that module and that of course if the AddHandler weren't being used then 
you would see the script source not get an error.

> This is not wrong, but there is redundancy - e.g. if you ever wanted to
> disable systen CGIs and removed the ScriptAlias, CGIs would still work via
> the AddHandler...

Yes, I'm aware of that, thanks.

> 
> In any case, the "Internal Server Error" means that the program did
> execute so CGI is OK. The problem is in the scripts - does the apache user
> (www-data) have execute permissions in
> /home/ken/public_html/cgi-bin/bash.cgi? Does the program work on the
> command line?

Yes:

temp:~# ls -l /home/ken/public_html/cgi-bin/            
total 16
-rwxr-xr-x    1 ken      www-data       75 Sep 16 09:56 bash.cgi
-rwxr-xr-x    1 ken      www-data     4861 Sep 16 14:07 cchello.cgi
-rwxr-x---    1 ken      www-data      139 Sep 13 16:02 quick.cgi

and note that the source code of the bash.cgi script is below in my 
original message, it is all of four lines, nothing more than echo 
statements.  You will note that there is now a compiled CGI there as well 
now (cchello.cgi) and it doesn't work either (along with the python one 
quick.cgi).  You will also note below if you look carefully that all 3 of 
these scripts are also in system-wide cgi-bin:

temp:~# ls -l /usr/lib/cgi-bin/
total 20
-rwxr-xr-x    1 root     root           75 Sep 16 09:49 bash.cgi
-rwxr-xr-x    1 root     root         4861 Sep 16 14:07 cchello.cgi
-rwxr-xr-x    1 root     root          139 Sep 13 16:04 quick.cgi

and work perfectly fine there.  You may not have noticed but I provided 
confirmation using md5sum below that the bash.cgi scripts in both locations 
are identical.

I will be hanging out in #apache on OPN (freenode) most of the day between 
say now and about 22:20 UTC.  If anyone would like to accost me there and 
point out my stupidity I would welcome it.

Thanks,

Ken Causey



> 
>>-----Original Message-----
>>From: Ken Causey [mailto:ken@ineffable.com]
>>Sent: Montag, 16. September 2002 18:01
>>To: users@httpd.apache.org
>>Subject: [users@httpd] User cgi-bin doesn't work with 1.3.26, I'm
>>stumped.
>>
>>
>>I'm using 1.3.26 from Debian testing feed:
>>
>>apache-ssl                 1.3.26.1+1.48-2
>>
>>And I'm having the strangest problem, cgi's that work just
>>fine in system
>>cgi-bin directory /usr/lib/cgi-bin/ will not work in a user cgi-bin
>>directory such as /home/ken/public_html/cgi-bin/
>>
>>http://temp.premiernet.net/cgi-bin/bash.cgi  works
>>
>>http://temp.premiernet.net/~ken/cgi-bin/bash.cgi  doesn't work
>>
>>These are the exact same script:
>>
>>temp:~# cat /home/ken/public_html/cgi-bin/bash.cgi
>>#!/bin/bash
>>echo "Content-Type: text/plain"
>>echo
>>echo "Bash says 'Hello'"
>>
>>temp:~# cat /usr/lib/cgi-bin/bash.cgi | md5sum | sed
>>'s/\-/\/home\/ken\/public_html\/cgi-bin\/bash.cgi/' | md5sum -cv
>>/home/ken/public_html/cgi-bin/bash.cgi OK
>>
>>Copy of server config can be found at
>>
>>http://temp.premiernet.net/~ken/httpd.conf
>>
>>All I get in error.log (even with LogLevel debug) is
>>
>>[Mon Sep 16 10:56:46 2002] [error] [client 205.229.226.241]
>>Premature end
>>of script headers: /home/ken/public_html/cgi-bin/bash.cgi
>>
>>ScriptLog output example:
>>
>>%request
>>Accept:
>>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,
>>text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0
>>.2,text/css,*/*;q=0.1
>>Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
>>Accept-Encoding: gzip, deflate, compress;q=0.9
>>Connection: keep-alive
>>Cookie: dtpref_rows="30"; dtpref_cols="40"
>>Host: temp.premiernet.net
>>Keep-Alive: 300
>>User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;)
>>Gecko/20020615
>>Debian/1.2.5-1.1
>>%response
>>
>>I can't figure this one out.  What else would you like to know?
>>
>>Ken Causey




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org