PDA

View Full Version : Owner/Group PHP/Apache saved files...


Justec
08-03-2007, 12:33 PM
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?

EverythingWeb
08-03-2007, 01:34 PM
suPHP

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

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

Justec
08-03-2007, 02:00 PM
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 :)

---
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?

Justec
08-03-2007, 03:01 PM
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 :/

EverythingWeb
08-03-2007, 03:32 PM
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.

EverythingWeb
08-03-2007, 03:34 PM
Yes, I was right ;)

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 :)