Reset the Recommended File and Directory Permission of Bitnami WordPress Website on Linux

As seen on Code Channels.

You have a WordPress website provisioned from Bitnami. Sometimes you may not be able to write or edit files in the WordPress directory, create new directories or edit files in the wp-content folder. The article introduces how to reset the recommended access permission of the WordPress files and directories.

1. Reset the ownership of the files and directories

The following command sets the ‘Owner’ = ‘bitnami’ and ‘Group’ = ‘daemon’ for all files and folders in WordPress.

sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/

2. Set the access permission 644 for all the files inside /installdir/apps/wordpress/htodcs/, and 755 for all the directories inside:

installdir/apps/wordpress/htdocs/
find /opt/bitnami/apps/wordpress/htdocs/ -type d -print0 | xargs -0 chmod 755
find /opt/bitnami/apps/wordpress/htdocs/ -type f -print0 | xargs -0 chmod 644

3. Overwrite the access permission of these files/folders:

750 for /installdir/apps/wordpress/htdocs/wp-config.php
775 for all the folders inside the wp-content directory /installdir/apps/wordpress/htdocs/wp-content/
664 for all the files inside for the wp-content directory /installdir/apps/wordpress/htdocs/wp-content/
664 for /installdir/apps/wordpress/htdocs/sitemap.xml or /installdir/apps/wordpress/htdocs/sitemap.xml.gz
750 for /installdir/apps/wordpress/htdocs

sudo chmod 750 /opt/bitnami/apps/wordpress/htdocs/wp-config.php
find /opt/bitnami/apps/wordpress/htdocs/wp-content/ -type d -print0 | xargs -0 chmod 775
find /opt/bitnami/apps/wordpress/htdocs/wp-content/ -type f -print0 | xargs -0 chmod 664
sudo chmod 664 /opt/bitnami/apps/wordpress/htdocs/sitemap.xml
sudo chmod 750 /opt/bitnami/apps/wordpress/htdocs/

Revisions

Tags: ,

No comments yet.

Leave a Reply