Some Perl CGI scripts are not working, 500 Internal Server Error occurred.
/var/log/httpd/suexec_log the following can be found:
uid: (10005/testdomain) gid: (1003/1003) cmd: lala_copy.cgi [2017-05-10 11:58:08]: (2)No such file or directory: exec failed (lala_copy.cgi) End of script output before headers: lala_copy.cgi
/var/www/vhosts/system/testdomain.tld/logs/error_log the following appeared:
End of script output before headers: lala_copy.cgi
Script was copied to the server in non ASCII.
End-of-line characters exist.
Check that there are no any end-of-line characters like ^M:
# vim -b /var/www/vhosts/testdomain.tld/httpdocs/cgi-bin/lala_copy.cgi
print "Content-type: text/html\n\n";^M
print "Hello, User1.";^M
Remove them if needed.
Please note that according to apache documention end-of-line characters cannot be recognized by apache:
When editing CGI scripts on Windows, end-of-line characters may be appended to the interpreter path. Ensure that files are then transferred to the server in ASCII mode. Failure to do so may result in "Command not found" warnings from the OS, due to the unrecognized end-of-line character being interpreted as a part of the interpreter filename.