Symptoms
-
Accessing to Webmail shows a "500 internal server error"
-
The following can be seen in the Apache log file:
# tail -f /var/log/httpd/error_log
[warn] [client 123.123.123.123] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Dec 05 17:21:00 2013] [error] [client 123.123.123.123] Premature end of script headers: index.php -
The following can be seen in the Suexec log file:
# tail -f /var/log/httpd/suexec_log
uid: (501/horde_sysuser) gid: (504/504) cmd: cgi_wrapper
command cgi_wrapper not in docroot (501)
Cause
CGI wrapper that comes with CentOS' apache RPM is hardcoded to allow only CGI scripts in /var/www
Resolution
Ensure that the /var/www
is not a symlink to any other directory:
-
Connect to the server via SSH
-
Check that
/var/www
is not a symlink to any other directory:# ls -ld /var/www
lrwxrwxrwx 1 root root 14 Oct 24 11:14 www -> /mnt/new_path/www/ -
If the symlink exists, remove it
# rm /var/www
-
Change the vhost location to, for example,
/mnt/new_path/www/
using thetransvhosts.pl
by referring to the following article: How to change virtual hosts location in Plesk for Linux? -
Create a real directory
/var/www/
and copy folders/var/www/cgi-bin
and/var/www/cgi-bin/webalizer
back from/mnt/new_path/www
:# cp -pR /mnt/new_path/www/cgi-bin /var/www/
# cp -pR /mnt/new_path/www/webalizer /var/www/