Question
Why do my /cpanel, /whm, /webmail, etc redirects suddenly give a 500 error?
Answer
If you look at the /var/log/apache2/error_log file, you may see the following error:
[Mon October 12 10:30:35.65231 2020] [cgid:error] [pid 15435:tid 127561897461982469] [client 1.2.3.4:25411] End of script output before headers: wredirect.cgi
suexec failure: could not open log file
fopen: Permission denied
These errors show that the /usr/sbin/suexec file is missing the expected capability flags:
root@whm-11-58-c7 [~]# getcap /usr/sbin/suexec
/usr/sbin/suexec = cap_setgid,cap_setuid+ep
Reinstalling the ea-apache24 package will fix this, restoring the capability flags and restarting Apache.
root@whm-11-58-c7 [~]# yum reinstall ea-apache24
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
[...]
Installed:
ea-apache24.x86_64 0:2.4.46-2.4.1.cpanel
Complete!
Your redirects should function properly at this point. These types of errors tend to happen when rsync is used to copy over full server images, breaking the capabilties flag on the suexec binary.