Joomla Writable files and folders with permission 755 on linux server

We have severals servers and VPS running Cpanel ,
We noticed that on some servers we have problems with Joomla script to make it work like it should do.
The problem on those servers: Joomla can not write some config files with permission 755 like every fresh instalation came, for example configuration.php can not be written by joomla if it is on 755 , so I have to set it to 777 with is dangerous.

But the fact is that the same install work perfectly on another servers.
Obviusly is something about Apache or PHP configuration.

Could someone help me to configure my apache or php in order that Joomla can write those files and folders with permissions 755 ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The problem is the owner - the "apache" user needs to own those files.  The files that you want to write should actually probably be something like 640, or 600, etc.  PHP files don't need to be executable to be parsed by the web server.
On other servers, perhaps running a different linux distro, apache runs as an "httpd" user, or "nobody".  So maybe your script is making one of those users the owner, instead of "apache"?

For more troubleshooting post your script, and the steps you are taking to install joomla.
ultra1Author Commented:
On all my servers I have Centos 4 OS, On all my servers Apache run as "nobody" and on all my joomla installs I have configuration.php  with the current user as owner and with permissions 755 , but.. on some servers joomla can write configuration.php and on another I get a warning that tells that configuration.php is unbritable.

I heard something about Mod SUPHP , but I am not sure if this is the solution
suPHP is probably why it's working on some servers.

suPHP causes PHP scripts to run as the user, rather than the 'nobody' user (or whatever user the webserver runs as).

There's security implications to this.  The main issue is it means that if someone can compromise one of the scripts thru the webserver, they can modify all the content, i.e. deface your site.

Setting the file to 777 does mean that someone else on the server could modify the file, but it's usually the lesser evil, unless you _trust_ your web scripts.  (Unless you wrote them, and you specialize in writing secure web scripts, I wouldn't trust them.  Especially not something huge and complex like Joomla, where bugs are likely to lurk in the shadows.)

You can also use group ownership, or ACL's, to allow only the 'nobody' user to modify the file... however, that does mean that anyone else coming in thru the webserver could edit the file; i.e. if another user wants to edit the file, they just create a PHP script in their homedir to do it, and access that script thru the webserver.

If security is a chief concern, put the site on a dedicated webserver, and/or make the configuration.php writable only when you need to edit it, and keep it 755 the rest of the time.

I would really really suggest avoiding suPHP unless you really really understand all the security implications.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.