By default the data dir is group webapps and owner apache, with chmod 770. It should work with that because both owner and group have full access like that.
If you chown the data dir webapps:webapps, it also works with just chmod 700. The .pref files inside then only need chmod 600, with also webapps:webapps.
As soon as I set data dir's group back to apache with 700/600, I get that error.
So if you have data dir webapps:webapps, and 700 it should work. If it doesn't then mod_ruid2 probably doesn't work correctly.
You could test that by creating a test php file inside /var/www/html/squirrelmail-1.4.22/test.php - chown it webapps:webapps
<?php
file_put_contents('test.txt', 'hello');
?>
run the file at e.g. www.domain.tld/squirrelmail/test.php, see what the owner of text.txt if its created.
Also, after putting RUidGid webapps webapps inside that <Directory, you did restart httpd?
Regarding to your article here: http://wiki.amservers.nl/Mod_ruid2
cd /usr/local/directadmin/custombuild
mkdir -p custom2/ap2/
cp configure/ap2/configure.php5 custom/ap2/
nano custom/ap2/configure.php5
A little bit confusing, is it really custom2 directory to create ? or just custom2 ?
After running, "./build php n"
I get this:
Notice: Following unknown configure options were used:
--with-ttf
Check './configure --help' for available options
/usr/local/directadmin/custombuild/custom/ap2/configure.php5: line 31: --disable-posix: command not found
*** There was an error while trying to configure php. Check the custom/ap2/configure.php5 file
[root@server custombuild]#