PERL / CGI weirdness
Posted: Wed Apr 16, 2008 11:38 am
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:
Checking the /var/log/httpd/suexec_log we see this when running test2.cgi (the renamed test.cgi file that run properly):
Permissions on both the test.cgi and test2.cgi file are as follows:
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

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
Code: Select all
[2008-04-16 10:28:18]: uid: (10122/clientname001) gid: (2524/2524) cmd: test2.cgi
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
Anyone have any insight? We hardly every see Perl scripts these days and when we do ... and they don't work ... /sigh