I currently have a CMS creating cache files/folders that should be deleted after a certain time but are not. After WEEKS of researching (no exageration), I have figured out the problem. These cache files/folders are being created with Apache, giving it the user "nobody". This was working just fine on a previous host with SuPHP, but I moved to mod_php with a new VPS. Here are a few of my issues, looking for the best solution(s). 1) I wanted eAccelerator on my system, so in Jan my host converted my php to mod_php. This is when the problem started. My host told me (which I have confirmed) that eAccelerator cannot run in SuPHp mode, and must be mod_php or FastCGI. My host recommended mod_php stating FastCGi was "relatively unstable and hence not recommended". So basically I want php to run with an accelerator (eAccelerator is not required but preferred), AND files created by Apache need to have a user other than "nobody". What options do I have? Thanks for any help!
Hello there, How are you trying to remove these files that the user/group nobody is giving you errors? Chris
apache creates files with username:group defined in httpd.conf, I don't get what the problem is? Files are not deleted? How are You deleting them? Cronjob? Perl or PHP script?
They are supposed to be deleted through a php script run through cron in my CMS. I tried creating my own delete file/folder script to delete them and it errors out with permission denied errors. It runs just fine through the browser. I guess I'm not 100% sure that is the issue with the CMS/cron script, but my delete file script will work just fine if the owners are correct. rod.magstuirt, can you elaborate more on where this is in the httpd.conf file? The only thing I see for "nobody" is: <code>PidFile logs/httpd.pid LockFile logs/accept.lock # Defined in /var/cpanel/cpanel.config: apache_port Listen 0.0.0.0:80 User nobody Group nobody</code>
You really should not be messing around with the user that Apache runs as, you will run into other issues, such as directory and file permissions for the server when running. Are you using a main stream CMS, or something custom? Chris
I'm using Drupal, one of the more popular CMS. Even though Apache is running as mod_php with no user/owner, is there a setting I can change so new files and folders created by Apache have a certain user? Or would that cause other problems with tmp files, etc?
well first of all php is running as mod_php for apache. I think there is something wrong with Drupals cron. Try to put something like: <?php function AddToLog($str){ $fh = @fopen("log.txt", 'a'); @fwrite($fh, $str."\n"); @fclose($fh); } $who = exec('whoami'); AddToLog($who); ?> Code (markup): And check for output in log.txt file. Maybe Drupal's cron runs as different user...