Owner/Group PHP/Apache saved files...

I know this has been discussed before, but just wanted to know how others handle this.

I’m thinking of writing a cron job to set the group on files owned by apache:apache to apache:website_account

I think that is probably the easiest way, but wanted to know if anyone else is using sudo somehow?

Or any other ideas?

suPHP

We’ve rolled it out on our new servers and it seems to be working great :slight_smile:

Pascal provided instructions on installing PHP5 in combo with PHP4 and using suPHP. Works a treat.

Your right. I remember taking part in that discussion. I’ve setup my CentOS5 / Iworx 3 test server and am testing sites now in that environment so maybe I’ll give suPHP a try on test box while im at it.

Thanks for the reminder :slight_smile:


Have you noticed any issues with using PHP as a CGI versus the normal apache way? I believe this is still a requirement of suPHP correct?

Do you think doing something like this would work?

visudo:

apache  ALL=(account) NOPASSWD:/home/account/account.com/html/file1.php, /home/account/account.com/html/file2.php

This might not be as easy as suPHP but if it lets me not run as a CGI and i only have a few sites that need it this might work. Guess ill give it a try on the test box when i get a chance.

Hmm… I guess I would have to run stuff on the shell with exec() though :confused:

Let me check something, as I believe that if you dont put the suPHP handlers in the domain.conf file, it will serve up PHP via the ‘normal’ Apache Handler.

Yes, I was right :wink:

http://www.williamrenfrew.me.uk/php.php
Apache 2.0 Handler - without the suPHP stuff in domain.com.conf

http://www.ew-owl.net/php.php5
CGI - using PHP5 parser thru suPHP

http://www.ew-owl.net/php.php
CGI - using PHP4 parser thru suPHP

All hosted on same server :slight_smile: