You don't have permission to access /wordpress/ on this server

Posted by Mads Skjern on Super User See other posts from Super User or by Mads Skjern
Published on 2013-11-01T07:17:11Z Indexed on 2013/11/01 10:01 UTC
Read the original article Hit count: 262

Filed under:

I have a server running Debian, with an installation of Apache 2.2.16, with PHP/MySQL, and now also an instance of Wordpress. I am playing around with user/group rights on Debian, and I can't make it work the way I want it to.

I believe Apache is using (only) the www-data user. The following setup works

/var/www# chown -R www-data:nogroup wordpress
/var/www# chmod -R 700 wordpress
/var/www# ls -l | grep wordpress
drwx------ 5 www-data nogroup  4096 Nov  1 09:30 wordpress

The following doesn't work.

/var/www# groupadd wordpress
/var/www# usermod -a -G wordpress www-data
/var/www# groups www-data
www-data : www-data wordpress
/var/www# chown -R nobody:wordpress wordpress
/var/www# chmod -R 770 wordpress
/var/www# ls -l | grep wordpress
drwxrwx--- 5 nobody wordpress  4096 Nov  1 09:30 wordpress

With the above settings, when I try to access the page in my browser, I get:

You don't have permission to access /wordpress/ on this server.

Here is my understanding: The folders are owned by the group wordpress, and the folders have all rights (read, write, execcute) given to the owning group, wordpress. Apache user www-data is a member of the group wordpress, so it should have all rights to the folders.

What have I misunderstood?

© Super User or respective owner

Related posts about apache