[Scottish] Apache weirdness

John Gordon Ollason john at houseofdeer.co.uk
Wed May 31 18:14:25 BST 2006


I have been trying to run some cgi-bin scripts written in Perl on the ccgi  
server at Plus Net. I have been getting seriously weird behaviour and Plus  
Net support is as useful as an udder on a bull, so I am posting here in  
the hope that some Perl/Apache guru can help me out.

History: The script has worked fine under Solaris, NetBSD, and RISCOS in  
the past.
The operating system of the cgi-bin server is supposed to be a Debian  
version, I think that the version of Apache is 1.3, and the Perl  
interpreter is perl, v5.8.4 built for i386-linux-thread-multi.

It was not clear from Plus Net's documentation how the cgi-bin directory  
was supposed to be set up. One source seemed to imply that it was the  
user's root directory. This seemed odd to me, but I gave it a try and was  
not surprised when it didn't work. So I set up directory

$mkdir -m 740 cgi-bin

as required by the instructions. Put my script into the directory and  
chmodded the permissions to 750 as instructed.

The script is invoked by the GET method transferring data via the  
$ENV{'QUERY_STRING'} variable and everything works fine if (at the server)  
the script is invoked and the output redirected to a file as follows (bash  
shell)

$export QUERY_STRING="...."
$ script>temp
$

The file temp contains the html generated by the script together with http  
command prefix

Content type: ...

just as expected.
The script includes the CGI::Debug module which detects no errors.

When the script is invoked from the browser (any browser, lynx, konqueror,  
Opera, Firefox) the server picks up a buggy version of the script that was  
deleted from my filespace days ago, and also fails to pick up the  
QUERY_STRING altogether.

Nevertheless the server does manage to return so html and this is where  
things get really strange.

Trying to work out what is happening I dump the whole %ENV array at the  
beginning of the output. This gives the expected results including the url  
of the script that ought to be executed and the QUERY_STRING that provides  
the data, but the rest of the page appears to be generated by the buggy  
version despite its being deleted from my file space, and the output  
clearly has not been generated using the QUERY_STRING data.

Two versions of the html can be found at

http://ccgi.houseofdeer.plus.com/cgi-bin/shell.html
and
http://ccgi.houseofdeer.plus.com/cgi-bin/served.html
The file served.html was saved from the browser and ftped back to the  
cgi-bin directory.

It is as though the server is finding the first part of one script, and  
joining it on to the second part of another. I have never seen anything  
like this before.

So my problem is this.

How do I get the server to pick up the correct version of the script from  
the url where it resides?

Has anybody else seen anything as weird as this?

John Ollason




More information about the Scottish mailing list