Applicable to:
- Plesk Onyx for Linux
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/
Comments
1 comment
Brand new server, Obsidian 18.0.45, Almalinux. Left only PHP 7.4, 8.0, 8.1 during setup - others removed. Above error message in the logs, webmail showing 500 internal server error.
Reinstalled PHP 7.3 and PHP by OS, and webmail started to work again. There seems to be some behind-the-scenes dependence of webmail on the older PHP versions even though they are outdated.
EDIT
Further testing shows it relies on PHP 7.3. Remove it, and your webmail breaks.
Please sign in to leave a comment.