When php is in it's default state “CLI”, php scripts run as the apache user. If any files are uploaded with php, then the files will be saved as the apache user.
If you'd like to have php run as the system user instead of “apache”, then you'd need to install suPhp.
suPhp is an option that can be set when installing the custombuild script:
http://files.directadmin.com/services/custombuild/1.1
When you get to the where you can edit the options.conf, do so, and replace:
php5_cli=yes php5_cgi=no
with
php5_cli=no php5_cgi=yes
followed by a full recompile/rewrite, so that apache is running php in cgi (suphp) instead of cli mode.
./build update ./build all d ./build rewrite_confs
Note that all logs for suPhp are stored in: /var/log/suphp.log
If you get any “Internal Server Error” messages, check the suphp.log to see why. Usually, things like writeable by “all” or “group” … or having the incorrect ownership of the file would cause this.
You may need to rewrite the webapps php scripts to reset the ownerships if you get internal server errors with them, eg:
./build roundcube ./build squirrelmail ./build phpmyadmin