I have a shared hosting server, with CentOS linux and cPanel running Apache with mod_php
. We use linux's user quotas to enforce that each website stays within their purchased amount of disk space. However, many websites have file upload systems either public or in their admins (CMS software, for example). Because this software runs under mod_php the files that are uploaded end up belonging to the user Apache runs under, and do not count against the user's disk quota.
The only way I can think to solve this is to write a script which looks through every directory in /home and chown
s all the files in public_html so they are owned by the correct user, and then have this script run hourly through cron. Before I write such a script, are there any better solutions? (Or does such a script exist?)
EDIT: I must be able to run mod_php. CGI php is not an option.