Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected permissions after testing with Roderick.

...

These directories are for WordPress,

WordPress DirectoryFiles and Directory PermissionsFiles PermissionsComment
/opt/web/php/dailyplanet.com/serveradmin:www-data serveradmin:www-data rwXr-X---Top level folder named by domain name.
/opt/web/php/dailyplanet.com/blog/ serveradmin:www-data rwXr-X---Location of WordPress instance for the domain name. We are using this folder rather than just the domain name to allow for more advanced configuration (such as separating the website with static content).
/opt/web/php/dailyplanet.com/blog/wp-content serveradmin:www-data /www-data:serveradmin rwXrwX---

Plugins and custom changes managed through the WordPress interface and requires write access.

In addition, WordPress verifies the user it is running as (in this case www-data) is the owner of this directory. So we must change the user for this directory.

There is a workaround (add link) but this requires custom modification to file x.

/opt/web/php/dailyplanet.com/blog/wp-admin/www-data:serveradmin rwXrwX---

Plugins and custom changes managed through the WordPress interface

. Requires

and requires write access.

In addition, WordPress verifies the user it is running as (in this case www-data) is the owner of this directory. So we must change the user for this directory.

There is a workaround (add link) but this requires custom modification to file x.

web Folder

This is where everything starts for web related work,

...

Code Block
languagebash
vi /opt/web/php/dailyplanet.com/blog/wp-config.php

Also while you are there add the following to the bottom of the file,

Warning

Given we are not using ACLs and groups instead you may not need to do this. Please test without doing this. If it does not work then try to change the owner=www-data and group=serveradmin (and add group +w). Call me if you don't understand.

Code Block
# WordPress determines write access when it finds a match between the Web Server ID and the directory being written too.
# This approach does not work with ACLs. During manual file upload the failure results in a prompt for FTP login information.
# Because we are using ACLs, override the write check by forcing a direct write.
define('FS_METHOD', 'direct');

This is to allow the ACL approach. Yes we could make the owner of the wp-content directory www-data, but that breaks the general approach by the Bonsai Framework.

Note

I'm not convinced this is the best resolution and it seems to me like a hack. File a bug with WordPress to get ACL information instead. In the interim, consider breaking the Bonsai Framework approach and just chowning www-data as the user with rwX.

Once you have saved the file, go back to your browser and click "Run the install".

...