Plesk RHEL 5.2 500 Error Virtualhosted Sites

Upon receiving a 500 error on multiple sites due to what appears to be an update to Plex followed by an update to RHEL5, we have found a way to track the issue early and resolve quickly. There is a script that will be posted at the end of this message.

Tracking the issue:

The first sign of trouble was the 500 error which appears in a virtualhosted server environment with more than one site failing, but also more then one site operating without issue. Since the operation of several sites were working this meant to us that the php, mysql and apache components were functioning normally. The 500 error hinted to us about cgi and perl possibly failing due to missing modules or linked headers. Also the failing sites appeared to be using Miva Merchant. Miva itself was not the cause of the issue however.

using the ldd command we were able to prove that all libraries were in the correct places and being found by ld.

ldd /usr/bin/mivavm => (0x0056b000) => /lib/ (0x008c4000) => /lib/ (0x008ef000) => /lib/ (0x008f6000) => /lib/ (0x00769000)
/lib/ (0x0074a000)

ldd /usr/bin/php-cgi => (0x007c5000) => /lib/ (0x00412000) => /usr/lib/ (0x009e6000) => /usr/lib/ (0x00926000) => /usr/lib/sse2/ (0x009ae000) => /lib/ (0x02e91000) => /lib/ (0x008f6000) => /usr/lib/ (0x001fd000) => /usr/lib/ (0x02e7e000) => /usr/lib/ (0x00911000) => /lib/ (0x00cb9000) => /lib/ (0x00b60000) => /lib/ (0x008c4000) => /lib/ (0x008ef000) => /lib/ (0x00993000) => /usr/lib/ (0x00292000) => /usr/lib/ (0x001cd000) => /usr/lib/ (0x00d33000) => /usr/lib/ (0x00d0a000) => /lib/ (0x00cfa000) => /lib/ (0x00183000) => /lib/ (0x00b76000) => /usr/lib/ (0x00b14000) => /lib/ (0x00444000) => /usr/lib/ (0x028a3000) => /lib/ (0x00110000)
/lib/ (0x0074a000) => /usr/lib/ (0x00cff000) => /lib/ (0x00de3000) => /lib/ (0x00931000) => /lib/ (0x0094b000)

Running the commands from the command line showed that they were completing fine and not segfaulting on as standard run. The environment for Miva is not set which explains the second line and this happens after the headers are sent which limits its cause.

Content-Type: text/html
Set-Cookie: htscallerid=
ec99e8351f3312599b5c4e1e0a78183b; expires=Thu, 28-Jun-2012 16:02:03 GMT; path=/

Configuration Error: Error loading configuration library: Unable to locate/load
Please contact the server administrator: webmaster@localhost



inspecting apache logs showed nothing but a restart a few days earlier.

[Tue Jun 28 22:39:22 2011] [notice] Apache configured — resuming normal operat ions

inspecting site specific logs from:


[Wed Jun 29 12:53:57 2011] [error] [client] suexec policy violation: see suexec log for more details
[Wed Jun 29 12:53:57 2011] [error] [client] Premature end of script headers: mivavm

inspecting suexec_log and suexec.log reveal the following:

lines in suexec_log
[2011-06-28 08:54:19]: uid: (#####/#####) gid: (2524/2524) cmd: mivavm

lines in suexec.log

[2011-06-28 08:59:34]: uid: (#####/#####) gid: (2524/2524) cmd: mivavm
[2011-06-28 08:59:34]: command not in docroot (/usr/bin/mivavm)

This hinted at an issue with suexec configuration of which docroot is precompiled in the command.
Upon inspecting /usr/local/psa/suexec/psa-suexec in vi, the file /usr/bin/minavm can be found
which hinted that this file is working and running the command yields no response which seems ok and no logs changed.

Running /usr/sbin/suexec and making note of the fact that it is old and that there are several versions gave the clue.

-r-s–x— 1 root root suexec
-r-s–x— 1 root apache suexec.saved_by_psa
-r-s–x— 1 root apache suexec.saved_by_psa.01.05;14:15
-r-s–x— 1 root apache suexec.saved_by_psa.01.06;18:03

Verified this assumtion with online post:

Modified the script to suit our environment

a1=`ls -la /usr/sbin/suexec | tr “-” ” ” | gawk ‘{print substr($0,1,56)}’`
a2=`ls -la /usr/local/suexec/psa-suexec | tr “-” ” ” | gawk ‘{print substr($0,1,56)}’`
if [[ “$a1” != “$a2″ ]]
cp /usr/sbin/suexec /usr/sbin/suexec-saved-$(date +%Y”-“%m”-“%d)
cp -Rfp /usr/local/suexec/psa-suexec /usr/sbin/suexec

-r-s–x— 1 root apache 19964 Mar 31 00:05 suexec
-r-s–x— 1 root root 11608 Jun 29 13:12 suexec-saved-2011-06-29
-r-s–x— 1 root apache 21656 Dec 23 2009 suexec.saved_by_psa
-r-s–x— 1 root apache 20896 Dec 18 2007 suexec.saved_by_psa.01.05;14:15
-r-s–x— 1 root apache 20612 Apr 25 2008 suexec.saved_by_psa.01.06;18:03

Site resume normal operation


About ttessier

Professional Developer and Operator of SwhistleSoft
This entry was posted in Server Development, Uncategorized and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *