Page 1 of 1

PERL / CGI weirdness

Posted: Wed Apr 16, 2008 11:38 am
by tungsten
Well, 2 posts in one day, these meds are really boosting my confidence! ;)

Anyhow, we are having an issue with some Perl scripts under one of our domains.

When we setup the domain for the client, the default PLESK /test/ folder is added. The test.cgi script in there runs just fine. We can even move that test script from the /test/ folder out and back into the /cgi-bin/ folder and have it run. So this is all good.

Here's the nutty part. NO OTHER scripts in the /cgi-bin/ folder will run. If I rename the test.cgi file (which runs fine as test.cgi) it fails to run. This applies if I rename if from my FTP client or from within the shell. It generates the following in error_log:

Code: Select all

[Wed Apr 16 09:56:15 2008] [error] [client 01.01.01.01] failed to open log file /var/log/httpd/suexec_log 
[Wed Apr 16 09:56:15 2008] [error] [client 01.01.01.01] fopen: Permission denied 
[Wed Apr 16 09:56:15 2008] [error] [client 01.01.01.01] Premature end of script headers: test2.cgi
Checking the /var/log/httpd/suexec_log we see this when running test2.cgi (the renamed test.cgi file that run properly):

Code: Select all

[2008-04-16 10:28:18]: uid: (10122/clientname001) gid: (2524/2524) cmd: test2.cgi
Permissions on both the test.cgi and test2.cgi file are as follows:

Code: Select all

-rwxr-xr-x   1 clientname001 psacln   626 Apr 16 09:55 test2.cgi
-rwxr-xr-x   1 clientname001 psacln   595 Apr 10 11:59 test.cgi
Our server is CentOS 4.5, Plesk 8.3.0 and RPM -q reports the following perl-5.8.8-4.el4s1 is installed.

Anyone have any insight? We hardly every see Perl scripts these days and when we do ... and they don't work ... /sigh

Posted: Fri Apr 18, 2008 8:21 am
by Highland
Tried this yet?

http://kb.parallels.com/en/430

Also, I had some similar problems and found that after some tinkering the CGI could run under httpdocs
http://atomicrocketturtle.com/forum/vie ... php?t=2106

Posted: Fri Apr 18, 2008 11:10 am
by tungsten
Thanks for the response Highland. Yeah. I've been through the knowledge base article. This issue is a complete mystery to me.

test.cgi (the default one that Plesk throws into any newly created domain) runs just fine.

We can move test.cgi around the server (either shell mv or through FTP) in and out of other active domains cgi-bins and it continues to run perfectly.

As soon as we cp test.cgi test2.cgi we get errors. Premature end of script headers via web browser and bad interpreter from the command line.

The craziest part about all of this is that it IS EXACTLY the same file. /boggle

And of course we still have the client with a pile of their own CGI scripts that are refusing to run. :(

I'll try re-reading the your other thread there and see if any of that sheds some light.

Posted: Fri Apr 18, 2008 4:13 pm
by scott
Selinux maybe?