Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am on Cpanel. I have root access.

When I create a new domain, a new user is created. Let's call it example.com with the user name being example. This will create:

/home/example/www/

For WP to work here, it requires the same access as apache. So I usually, for updating etc, need to give "nobody" user access.

However, for FTP etc to work normally, I need files and folders to be owned by the user (example in my case).

What do people recommend. Should I add example to the nobody group? Or what else?

This is driving me up the wall.

Thanks!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

By default, new installs of cPanel run PHP under the SuPHP loader, which cause PHP scripts to be run as their user owner instead of the nobody user. Under this scheme the proper way to setup Wordpress (and other PHP scripts/apps) is to set the ownership to all files/directories to the cPanel user and group. Access permissions should be set to 0644 for files and 0755 for directories. Under SuPHP, you will receive a 500 error should these not be set properly, so you will know right away.

Under this setup the added benefit is that the files are always accessible to the cPanel user by FTP/File Manager.

You can check if you are currently running SuPHP in the WHM under Apache Configuration -> Configure PHP and SuExec or using the script:

/usr/local/cpanel/bin/rebuild_phpconf --current

If you aren't, and SuPHP support isn't built on the server, you can enable it by using the EasyApache build wizard from the WHM or /scripts/easyapache from a root shell.

share|improve this answer
    
Thanks Garrett. For someone else in the future, here is what I discovered. The following works: chown -R example:nobody /home/example/www/ –  PKHunter Sep 16 '12 at 12:53
add comment

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.