Portal Home > Knowledgebase > Articles Database > Apache keeps taking file ownership. Help!


Apache keeps taking file ownership. Help!




Posted by jgray1978, 04-08-2008, 11:11 AM
FreeBSD 7.0 Apache 2.2 PHP5 Mysql 5.1 I have been battling this for a while. A user will setup a CMS like joomla, e107, etc and every time the CMS changes files either with user interaction on the website or the admin changing things in their cms admin web page, apache takes ownership of the files. I have tried installing suPHP, FastCGI, and most recently suexec. I am not having any luck with this. I really don't know what I am doing with these recent additions but meanly going on suggestions. Does anyone know of a walk through to fix this permission problem? Anyone with some good advise? Surely not everyone is having to write a script to chown each user's dir and run a cronjob every 5 minutes.

Posted by ub3r, 04-08-2008, 11:46 AM
You have to recompile php and apache to have php run on phpsuexec, or php-cgi, instead of mod_php. Then, you're going to have to do a bunch of work on each of your client accounts such as: 1) Change permissions of all chmod 777 files to 755 2) Remove any php flags being declared in a user's .htaccess files 3) change ownership of all 'nobody' owned files to the specification of your user's account.

Posted by jgray1978, 04-08-2008, 11:53 AM
Ok, it has been suggested to me to just make all the users part of the www group. Will that allow them to modify or delete any of the files that apache has taken over?

Posted by Dawson, 04-08-2008, 12:28 PM
If the files are owned by the WWW group, making the users part of that group would indeed allow them to modify/delete files.

Posted by tix3, 04-08-2008, 01:39 PM
Either compile php with phpsuexec or run a cron job that chowns and chmod the files as wanted.

Posted by jgray1978, 04-08-2008, 03:23 PM
Well, putting the users into the "www" group which is apache's group did not help. It allows users to change filenames now and change permissions up but not down. I have gone to php5 in ports, make deinstall, make clean, make config (nothing in there for phpsuexec), and make install. This has to be the most dumb freaking problem that I have ever come across that does not have a straight answer. Any continued help would be appreciated.

Posted by Steve_Arm, 04-08-2008, 03:33 PM
I can't see how suexec hasn't helped you. The site will run under the user so there is now way the script will create files as www.

Posted by jgray1978, 04-08-2008, 03:40 PM
Well, I deinstalled and reconfiged suexec into apache 2.2 and reinstalled. It was not there by default. I added the LoadModule....so line for it and restarted apache. Is that all that needs to be done? I can't find a way to test it easily and I have a user that says his files are still jacking.

Posted by Steve_Arm, 04-08-2008, 03:43 PM
This is a working configuration for suexec ( for my installations ) --enable-suexec --with-suexec-bin=/usr/local/apache2/bin/suexec --with-suexec-caller=www --with-suexec-docroot=/home --with-suexec-userdir=public_html --with-suexec-uidmin=1000 --with-suexec-gidmin=1000 With fcgi add FastCgiWrapper /usr/local/apache2/bin/suexec Check the apache's error log to see if it has loaded without errors



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
arpnetworks (Views: 648)