• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

HOWTO: Troubleshooting CGI premature end of script headers

D

danbell

Guest
Just thought I would write a quick guide on this as it such a recurring question.

Firstly, make sure you upload the script into the cgi-bin in ASCII mode. This is a problem more oftern then you can imagine. chmod 755 the script. Check permissions are USERID:psacln (the directory should be USERID:psaserv). Of course check that the site has CGI support ticked. You can also verify the syntax of the script by running "perl -c SCRIPTNAME.CGI" and it should report syntax ok.

If you're still having problems then check the logs. Check /home/httpd/vhosts/DOMAIN/statistics/logs/error_log (some installs my use /var/www/ as opposed to the plesk standard /home/httpd/vhosts) and look for errors. This log file will usually show the error message on the screen. You may also need to check /var/log/httpd/error_log. If you still don't see the problem then check /var/log/httpd/suexec.log for any

Finally, check the correct suexec version is being used. do an "ls -la /usr/sbin/suexec" and compare that to /usr/local/psa/suexec/psa-suexec. If they are different then make a backup copy of /usr/sbin/suexec to something like /usr/sbin/suexec.orig. then either copy or make a symlink of /usr/local/psa/suexec/psa-suexec into the /usr/sbin directory.

Hopefully this has been helpful.
 
Thanks Dan, I am sure it will be very helpful to future readers. It is nice to have it all combined into a single post, much easier than wading through dozens of other posts!

If you have more free time, there are many other subjects which also would benefit from gleaning, combining, condensing.... hehehe
 
Dan:

James is right; having all this info in one place makes life a lot easier for those searching for a solution to a problem.

May I suggest that you (and the whole community) take a look at http://www.unix-serve.com/ . This could become an excellent repository of HOWTOs for Linux hosting in general, and Plesk in particular.

John
 
Back
Top