Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm configuring Wordpress for a friend, and I just screwed up the Wordpress directory permissions (I suspect) using setfacl. Webfaction doesn't allow sudo or allow me to change the directory group ownership using chown.

Now it appears that something I did is causing the entire application to give me 403 errors when I try to access it.

The current directory listing looks like this (I set the whole thing to 777 temporarily to try to recover access to it):

drwxrwsr-x+  6 myusername myusername  4096 Mar  2 07:07 ./
drwxr-xr-x   3 root        root         4096 Feb 25 19:48 ../
-rwxrwxr-x+  1 myusername myusername   286 Mar  2 06:33 gzip.php
-rwxrwxr-x+  1 myusername myusername  4831 Mar  4 20:02 .htaccess
-rwxrwxr-x+  1 myusername myusername   397 Feb 25 19:49 index.php
-rw-rw-r--+  1 myusername myusername 15606 Feb 25 19:49 license.txt
-rw-rw-r--+  1 myusername myusername  9200 Feb 25 19:49 readme.html
drwxrwsr-x+  6 myusername myusername  4096 Feb 25 19:49 .svn/
-rwxrwxr-x+  1 myusername myusername  4337 Feb 25 19:49 wp-activate.php
drwxr-xr-x+ 10 myusername myusername  4096 Mar  4 20:03 wp-admin/
-rwxrwxr-x+  1 myusername myusername 40283 Feb 25 19:49 wp-app.php
-rwxrwxr-x+  1 myusername myusername   226 Feb 25 19:49 wp-atom.php
-rwxrwxr-x+  1 myusername myusername   274 Feb 25 19:49 wp-blog-header.php
-rwxrwxr-x+  1 myusername myusername  3931 Feb 25 19:49 wp-comments-post.php
-rwxrwxr-x+  1 myusername myusername   244 Feb 25 19:49 wp-commentsrss2.php
-rwxrwxr-x+  1 myusername myusername  3485 Feb 25 20:15 wp-config.php
drwxr-xr-x+  6 myusername myusername  4096 Feb 26 08:52 wp-content/
-rwxrwxr-x+  1 myusername myusername  1255 Feb 25 19:49 wp-cron.php
-rwxrwxr-x+  1 myusername myusername   246 Feb 25 19:49 wp-feed.php
drwxrwxr-x+  9 myusername myusername  4096 Feb 25 19:49 wp-includes/
-rwxrwxr-x+  1 myusername myusername  1997 Feb 25 19:49 wp-links-opml.php
-rwxrwxr-x+  1 myusername myusername  2453 Feb 25 19:49 wp-load.php
-rwxrwxr-x+  1 myusername myusername 27787 Feb 25 19:49 wp-login.php
-rwxrwxr-x+  1 myusername myusername  7774 Feb 25 19:49 wp-mail.php
-rwxrwxr-x+  1 myusername myusername   494 Feb 25 19:49 wp-pass.php
-rwxrwxr-x+  1 myusername myusername   224 Feb 25 19:49 wp-rdf.php
-rwxrwxr-x+  1 myusername myusername   334 Feb 25 19:49 wp-register.php
-rwxrwxr-x+  1 myusername myusername   226 Feb 25 19:49 wp-rss2.php
-rwxrwxr-x+  1 myusername myusername   224 Feb 25 19:49 wp-rss.php
-rwxrwxr-x+  1 myusername myusername  9655 Feb 25 19:49 wp-settings.php
-rwxrwxr-x+  1 myusername myusername 18644 Feb 25 19:49 wp-signup.php
-rwxrwxr-x+  1 myusername myusername  3702 Feb 25 19:49 wp-trackback.php
-rwxrwxr-x+  1 myusername myusername  3210 Feb 25 19:49 xmlrpc.php

The getfacl output looks like this:

# file: .
# owner: myusername
# group: myusername
user::rwx
group::r-x
group:apache:rw-
mask::rwx
other::r-x

I simply wanted to change the ownership to myusername:apache and the file permissions to 755. I have no idea how to fix the permissions now.

Any help would be really appreciated!

Thanks, Tom

share|improve this question

2 Answers 2

up vote 0 down vote accepted

What does getfacl on wp-content say? Does Apache have x permission (directory search/access)?

If not, try setfacl -R -m 'g:apache:rwX' . or similar.

Or remove all ACLs using setfacl -Rb ..

share|improve this answer
    
That fixed it. Thanks! –  tommytwoeyes Apr 13 '11 at 13:08

Not having webfaction... Is it group apache or do you need to add permissions for user apache?

Their documentation seems to indicate a user apache needing access instead of group. so perhaps:

setfacl -R -m u:apache:rwx .

man setfacl should tell you more

Another possibility of the source of the 403 error is the contents of the .htaccess file... if that's not correct, then apache might be denying access to this directory based on those rules. (seeing how that was modified today).

share|improve this answer
    
Group apache should be fine. The problem is that group Apache is missing x bits, so Apache can't see inside the wp-content directory. Your command would work, but would leave the group permissions in a weird state. –  Mikel Mar 5 '11 at 5:54
    
Thanks, your advice helped tremendously, and I was able to get it fixed. Sorry, but ServerFault says I don't have sufficient reputation points (my account is relatively new) to vote up your answer. –  tommytwoeyes Mar 7 '11 at 14:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.