PDA

View Full Version : PHP: SuExec not working?


CryoGenID
1st December 2006, 03:16 PM
Hello!

We've just made a quick test-install of the new 8.1.0-Version on a clean CentOS 4.3-Server.

I wonder why Plesk didn't install PHP5 by default?
Well, we'll have to find a way to install that now :-(

But the real problem is this (that problem already occured with Plesk 8.0.1 and should have been solved in this version said the engineers at swsoft. but it obviously isn't :-( ):
When we run php-scripts, they DON'T run as the corresponding domain-user! They run as apache:apache which is wrong.
Because for example Typo3 tries to create directories with apache:apache, and then the FTP cannot access the directories any more and vice versa :-(

Do you possibly know a way of making PHP/Apache run the Scripts as the domain-user?

Thanks for your help!

Best regards,

Chris

P.S.:
We also want the "Spam" for SWSoft-Products out of our expensively bought Products!

nb__
2nd December 2006, 12:40 AM
Do you possibly know a way of making PHP/Apache run the Scripts as the domain-user?

Run PHP script via CGI

CryoGenID
2nd December 2006, 02:15 AM
But then I'd have to change all scripts to contain the "#!/bin/xxx/php", right?
And that would be no option...

Shouldn't SuExec do that (running the script as the domainuser)?

nb__
2nd December 2006, 04:09 AM
But then I'd have to change all scripts to contain the "#!/bin/xxx/php", right?

Yep

Shouldn't SuExec do that

Nope. Would you explain why?

CryoGenID
2nd December 2006, 04:36 AM
Hm.. then I must have gotten the purpose of SuEXEC wrong ;)
So suEXEC only runs CGI-Scripts as the user and group the domain belongs to, right?

Is there another possibility than using suPHP (which was freaking difficult to install and configure for Plesk) to achieve Apache running PHP-Scripts as the domain user the script belongs to?

Thanks again for your help :-)

nb__
2nd December 2006, 04:57 AM
So suEXEC only runs CGI-Scripts as the user and group the domain belongs to, right?

Yes, you're right. Refer to apache's docs:

What is suEXEC?

The suEXEC feature -- introduced in Apache 1.2 -- provides Apache users the ability to run CGI and SSI programs under user IDs different from the user ID of the calling web-server. Normally, when a CGI or SSI program executes, it runs as the same user who is running the web server.

Is there another possibility

I guess not. I don't know such way.

breun
2nd December 2006, 10:04 AM
We've just made a quick test-install of the new 8.1.0-Version on a clean CentOS 4.3-Server.

I wonder why Plesk didn't install PHP5 by default?
Well, we'll have to find a way to install that now :-(

Plesk uses PHP as installed by the OS. Since CentOS 4 comes with PHP 4 you're running PHP 4. Atomic Rocket Turtle (http://www.atomicrocketturtle.com/) has Plesk-compatible PHP 5 packages for Fedora and RHEL/CentOS in his atomic yum channel. Check out the PHP Project page (http://www.atomicrocketturtle.com/Joomla/content/view/141/29/) for some more info.

But the real problem is this (that problem already occured with Plesk 8.0.1 and should have been solved in this version said the engineers at swsoft. but it obviously isn't :-( ):
When we run php-scripts, they DON'T run as the corresponding domain-user! They run as apache:apache which is wrong.
Because for example Typo3 tries to create directories with apache:apache, and then the FTP cannot access the directories any more and vice versa :-(

Do you possibly know a way of making PHP/Apache run the Scripts as the domain-user?

It is not necessarily wrong, but it is not what you want. The apache user runs the scripts using mod_php, so any files created are created by apache. To have the scripts run as the domain user you'd have to install suPHP. Searching the forums show people have succesfully done this, but it isn't exactly plug 'n play. It would indeed be nice if Plesk would include this by default.

CryoGenID
2nd December 2006, 10:39 AM
Thanks for your reply :-)

Well, then we'll have to install suPHP manually again (which creates a lot of trouble actually but if there's no other possibility...)!

Thanks again :)

thewolf
4th December 2006, 07:05 AM
Hi,

We'd like to see suPHP included in Plesk too!

Thanks.

dom974
5th December 2006, 04:13 AM
There's a thread where I explained a bit how to do it

still true what you say, people have been asking for months now so that plesk includes this option and do they listen to us ?
I still cannot understand, in my hosting business, customers feedbacks and ideas are very important things and I really do care about it