Ownership Issue on WordPress

Scolpy

Verified User
Joined
Feb 25, 2009
Messages
137
Hello!

I'm using WordPress on some of my websites, and I saw that every time that WordPress creates directories(of images gallery, for example), the ownership of those directories are apache:apache instead of the user ownership.

How can I resolve that issue? because now every-time those directories creates, I can't upload file into those directories till I change manual the ownership to the user ownership.

Thanks!
 
Last edited:
I have a similar problem. I have a smarty cache dir and it isn't writeable under its own user at chmod 775, but it works when i chown it apache:apache. If I want to make it work under its own user, I need to chmod 777 it. Surely there must be a way to fix this without changing to suphp?
 
Yes. Then files will be owned by the user not by the webserver user.

See the custombuild section of forum.
 
Yes. Then files will be owned by the user not by the webserver user.

See the custombuild section of forum.
But PHP CGI is more slower and insecure than PHP CLI - so there is no other solution for this issue?
 
If you don't want to move to ngix+fastcgi from apache+mod_php, just chown -R your files. Some plugins will also require some extra file permissions.
 
Before we started building servers running PHP as CGI we ran cronjobs (per domain basis) which would restore site-user ownership to all files in a site often. How often? We found that running them every minute wouldn't impact the server greatly.

However I believe you can teach the user to change ownership through the DirectAdmin Files facility.

Jeff
 
I've been thinking to use mod_ruid for a while now, and decided to got for it. My problem has been resolved with this :) Are there any other benefits or things I should know about using mod_ruid?
 
I've been thinking to use mod_ruid for a while now, and decided to got for it. My problem has been resolved with this :) Are there any other benefits or things I should know about using mod_ruid?
We use mod_ruid on all our systems, since otherwise we have to use suphp or chmod files/dirs.

With mod_ruid all problems for us / our customers are solved.

First of all: install mod_ruid after that folow the steps below;

Path: /usr/local/directadmin/data/templates/custom/
Files: 'virtual_host2.conf', 'virtual_host2_secure.conf', 'virtual_host2_secure_sub.conf', 'virtual_host2_sub.conf'
* If they don't exist please 'cp' them to 'custom' from 'templates'.

Replace
SuexecUserGroup |USER| |GROUP|
with
RMode config
RUidGid |USER| |GROUP|
RGroups apache
Now lets rewrite HTTP config
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d800
Restart HTTPd and it should be done
 
Yes I had followed these steps, but I was just wondering if all this does is just fixing these kinds of problems, or that I also should chmod /home dirs different or that it offers anything else. As I understand it I can see running top the user for a quick moment instead of apache. Maybe theres something else like that? :)
 
You don't need to chmod anything, it should be okay after installing mod_ruid.
Indeed, now if a user is running a script you should see the users 'username' instead of 'apache'.
 
We use mod_ruid on all our systems, since otherwise we have to use suphp or chmod files/dirs.

With mod_ruid all problems for us / our customers are solved.

First of all: install mod_ruid after that folow the steps below;

Path: /usr/local/directadmin/data/templates/custom/
Files: 'virtual_host2.conf', 'virtual_host2_secure.conf', 'virtual_host2_secure_sub.conf', 'virtual_host2_sub.conf'
* If they don't exist please 'cp' them to 'custom' from 'templates'.

ReplacewithNow lets rewrite HTTP configRestart HTTPd and it should be done
I need to do those steps after the installation, right?
 
Run these commands to find it:
Code:
updatedb
locate apxs

@ my box its /usr/sbin/apxs

Also the README says mod_ruid.c, but it should be mod_ruid2.c
 
Last edited:
Run these commands to find it:
Code:
updatedb
locate apxs

@ my box its /usr/sbin/apxs

Also the README says mod_ruid.c, but it should be mod_ruid2.c
Thanks man!

I installed this and the issue seems to be resolved :)
 
Back
Top