Portal Home > Knowledgebase > Articles Database > Files uploaded with php scripts are owned by apache on Directadmin
Files uploaded with php scripts are owned by apache on Directadmin
Posted by aqoz, 09-24-2012, 04:41 AM |
Hello Everyone,
Uploaded files are owned by apache, I have DirectAdmin installed and also mod_suexec is loaded into Apache.
So is there anyway to upload file with account owner?
Really Thanks
|
Posted by foobic, 09-24-2012, 05:13 AM |
You need to set php5_cgi in custombuild.
http://help.directadmin.com/item.php?id=197
|
Posted by aqoz, 09-24-2012, 07:00 AM |
I'm really not familar with DirectAdmin CustomBuild, will this cause data loss? even mysql upgrade ?
|
Posted by foobic, 09-24-2012, 07:33 AM |
It shouldn't cause data loss, most likely just some 500 errors until you adjust your file permissions, but you'd be wise to verify your backups first anyway.
And if you're not comfortable using custombuild on a DA server then you really need paid management. Even without changing PHP options you should be running custombuild regularly to keep your system updated.
|
Posted by aqoz, 09-24-2012, 08:13 AM |
Really Thanks,
does it have effect on performance?
and what about this topic, I think it will solve my problem. right?
Last edited by aqoz; 09-24-2012 at 08:25 AM.
|
Posted by Patrick, 09-24-2012, 09:08 AM |
Don't use suPHP! It's slow and bloated... you want FastCGI! It has the same security benefits (files + processes owned by user and not web server) and it is MUCH, MUCH faster although it does use more RAM. I'm not familiar with DirectAdmin but look for a tutorial that will help you setup FastCGI.
|
Posted by aqoz, 09-24-2012, 09:46 AM |
Thanks a lot,
I can't install FastCGI right now, But I tried it before on a production environment and it was good!
Can I achieve this with suExec?
http://httpd.apache.org/docs/2.2/suexec.html
|
Posted by Patrick, 09-24-2012, 11:18 AM |
Nope. That's for CGI scripts only. If you can't install FastCGI then go for suPHP until you can. It's better than nothing and will have files uploaded by PHP scripts be owned by the user.
|
Posted by foobic, 09-24-2012, 11:37 AM |
Yes, suPHP is slower than mod_php. Although if your VPS is fast you may not notice much difference.
Did you look at the date of that thread? In principle, yes, you could do something like that (allowing for anything that's changed in the past 8 years) and install suPHP from scratch but the usual, easy way is to use custombuild.
Last edited by foobic; 09-24-2012 at 11:39 AM.
Reason: clarity
|
Posted by aqoz, 09-24-2012, 11:47 AM |
Thanks again,
I'll take your advices.
Let me explain the source of my problem:
I was trying to install a component on Joomla! and it encountered an error. I figured it out and it seems that PHP is running under apache user and also uploaded files are with apache ownership and can't access directories that are owned by another user even with 777 permission. so now I need to install suPHP or FastCGI.
also I have mod_ruid2 installed which is:
why can't these work?
Thanks
Last edited by aqoz; 09-24-2012 at 11:50 AM.
|
Posted by foobic, 09-24-2012, 12:06 PM |
mod_ruid2 should do the same thing. It's not a standard configuration but there's a long howto thread about it on the DA forums. If new uploads are still Apache-owned after you've installed it then you probably didn't do it right.
|
Posted by aqoz, 09-25-2012, 09:14 AM |
Really Thanks for your help.
|
Add to Favourites Print this Article
Also Read