(dv) 4.0:Fix target uid/gid Apache 500 errors

  • This page was last modified on November 28, 2011, at 10:16.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

The Bug

After changing the operation of PHP for a domain to run as a FastCGI module instead of an Apache module, you receive a "500 Internal Service Error" message, with the error log for the domain containing the following entry:

suexec policy violation: see suexec log for more details

When looking at the suexec log at /var/log/httpd/suexec.log you would see the following corresponding lines (modified to match your site):

[2011-07-20 04:28:34]: target uid/gid (10013/505) mismatch with directory (0/0) or program (0/0)
[2011-07-20 04:37:00]: uid: (10013/exampledomain) gid: (505/505) cmd: cgi_wrapper

The Fix

This error typically occurs after an upgrade to the Apache service on your (dv) Dedicated-Virtual Server, but thankfully the fix is relatively simple. Run the following commands via SSH:

cp -p /usr/sbin/suexec /usr/sbin/suexec.backup 
cp -p /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec
web

These commands back up the existing suexec executable file, makes a new copy using a pre-existing executable that comes with Plesk, and finally rebuilds the Apache configuration. The error should no longer occur for that domain.

Thanks to (mt) Media Temple support tech Chason for locating this fix!