FAQ
I solved the problem removing mod_php (version 4.2.3 in the problematic
server, 4.2.2 in the good one). Strange, I was not executing a php file.

I will now continue my search, to narrow even more the problem
location possibilities.

Joao Carlos Mendes Luis wrote:
Hi,

I think I have a problem similar to the one described in
http://marc.theaimsgroup.com/?l=apache-httpd-users&m=101636616504545&w=2

I'm running Apache 1.3.27+mod_ssl-2.8.11, and mod_php4-4.2.3 over a
FreeBSD 4.7-STABLE. Everything very recent. ;-) (but the problem was
happening on 1.3.26 and FreeBSD 4.6-STABLE also)

We don't use CGI a lot, but this week I was installing mailman and
discovered that CGIs are not working at all, despite my http.conf file
is mostly similar to another site I keep and works perfectly.

The URL above says to run strace, but I dont have strace on
FreeBSD, and ktrace would be a probable PITA to use in this case.

Let detail my problem:

1) No CGI executes correctly. Not even the test-cgi and printenv
scripts that come with apache. All of then die with the famous error:

[Fri Oct 11 18:31:20 2002] [error] [client xxxx] Premature end of scrip
t headers: /usr/local/www/cgi-bin-dist/test-cgi

2) The scripts are beeing executed! I wrote this one to check:

----8<---- cut here ----8<----
#! /bin/sh

Id()
{
/bin/cat <<END
Content-Type: text/plain

Alo...
END
/usr/bin/id
echo Pid = $$
}

(
/usr/local/sbin/lsof > /tmp/lsof
sleep 5
Id > /tmp/tee
Id
) 2> /tmp/error
----8<---- cut here ----8<----

With this script I found that this output from lsof is wrong:

----8<---- cut here ----8<----
...
sh 44196 www cwd VDIR 91,0 512 2812706
/usr/local/www/cgi-bin-dist
sh 44196 www rtd VDIR 116,131072 1024 2 /
sh 44196 www txt VREG 116,131072 463748 501 /bin/sh
sh 44196 www 2u PIPE 0xd0b409a0 16384 ->0xd0e50ac0
sh 44196 www 3u VREG 91,0 0 4465159
/usr/var/run/httpd.mm.1972.sem
sh 44196 www 10r VREG 91,0 176 2320516
/usr/local/www/cgi-bin-dist/id
sh 44197 www cwd VDIR 91,0 512 2812706
/usr/local/www/cgi-bin-dist
sh 44197 www rtd VDIR 116,131072 1024 2 /
sh 44197 www txt VREG 116,131072 463748 501 /bin/sh
sh 44197 www 2w VREG 253,0 252 6 /tmp/error
sh 44197 www 3u VREG 91,0 0 4465159
/usr/var/run/httpd.mm.1972.sem
...
----8<---- cut here ----8<----

Note that there is NO STDIN (0) or STDOUT (1) descriptors open!

The same script on the working server gives this:

----8<---- cut here ----8<----
...
sh 41843 www cwd VDIR 91,0 512 2460209
/usr/local/www/cgi-bin-dist
sh 41843 www rtd VDIR 116,131072 1024 2 /
sh 41843 www txt VREG 116,131072 458788 8336 /bin/sh
sh 41843 www 0u PIPE 0xd1cbc4e0 16384
sh 41843 www 1u PIPE 0xd1cbd200 16384 ->0xd18dffa0
sh 41843 www 2w VREG 91,0 55902710 3126872
/usr/home/www/coe/log/error.log
sh 41843 www 3u VREG 91,0 0 857127
/usr/var/run/httpd.mm.36789.sem
sh 41843 www 10r VREG 91,0 176 2460325
/usr/local/www/cgi-bin-dist/id
sh 41844 www cwd VDIR 91,0 512 2460209
/usr/local/www/cgi-bin-dist
sh 41844 www rtd VDIR 116,131072 1024 2 /
sh 41844 www txt VREG 116,131072 458788 8336 /bin/sh
sh 41844 www 0u PIPE 0xd1cbc4e0 16384
sh 41844 www 1u PIPE 0xd1cbd200 16384 ->0xd18dffa0
sh 41844 www 2w VREG 253,0 270 18 /tmp (mfs:242)
sh 41844 www 3u VREG 91,0 0 857127
/usr/var/run/httpd.mm.36789.sem
...
----8<---- cut here ----8<----


Could somebody help, please? I really don't know what else to do, or
how could this happen.

BTW: This is not lack of descriptors:
krakatoa::root [575] sysctl -a | grep files
kern.maxfiles: 2088
kern.maxfilesperproc: 1879
kern.openfiles: 459
p1003_1b.mapped_files: 0
krakatoa::root [576]

And of course, pipes do work on this machine: ;-)

krakatoa::root [576] echo 1 2 3 | wc
1 3 6
krakatoa::root [577]

Thanks in advance,

Jonny

--

Jonny

--
João Carlos Mendes Luís - Networking Engineer - jonny@jonny.eng.br



---------------------------------------------------------------------
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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 5 | next ›
Discussion Overview
groupusers @
categoriesapache
postedOct 11, '02 at 11:48p
activeOct 13, '02 at 1:16a
posts5
users4
websitehttpd.apache.org
irc#httpd

People

Translate

site design / logo © 2022 Grokbase