System file: ext4
I changed the owner of files to apache:
with the command:
chown -R apache: wp.localhost
Then, I could not change the permissions of directories in wp.localhost nor the wp.localhost itself
I use the command chmod +w wp.localhost
for example. and I do not see any permission change on it.
I also changed the group of folders by the command again, But did not solve the problem.
chown -R apache:users wp.localhost
Commads and permissions before and after:
#ls -ld wp.localhost
drwxr-xr-x 6 apache users 4096 Mar 28 15:26 wp.localhost/
# chmod +w wp.localhost
# ls -ld wp.localhost
drwxr-xr-x 6 apache users 4096 Mar 28 15:26 wp.localhost/
Best Answer
If you want to grant global write permission on that directory, you have to do
This is because omitting the 'who is affected' letter (
u
,g
,o
ora
) impliesa
, but won't set bits that are set in your currentumask
. So, for example, if yourumask
was0022
, the 'write' bit is set in the 'group' and 'other' positions, andchmod
will ignore it if you don't specifya
explicitly.The
chmod
man page is explicit about this:[1] Think carefully before doing this!