File Permissions need to be updated each month on LAMP with WordPress

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Permissions

bnsupport ID: c2d01ecb-1f2f-2f69-b356-197740a07856

bndiagnostic output:

? Apache: Found possible issues
? Connectivity: Found possible issues
? Resources: Found possible issues

bndiagnostic failure reason: The suggested guides are not related with my issue

Each month we need to SSH into the LAMP server and update the file permissions such that WordPress can upload images, update plugins etc. An example of these commands are:

sudo chown -R bitnami:daemon /home/bitnami/htdocs/wp-content
sudo find /home/bitnami/htdocs/wp-content -type f -exec chmod 664 {} ;
sudo find /home/bitnami/htdocs/wp-content -type d -exec chmod 775 {} ;

We installed directly from AWS and made no changes to ownership etc. It’s incredibly frustrating to have to do this every month, especially for image uploads.

How can we fix this permanently such that bitnami can run WordPress correctly on LAMP?

Hi @cbcjock,

Thanks for using Bitnami. According to the bnsupport code you provided us with, I see you installed the WordPress application into /opt/bitnami/apache2/htdocs folder directly, which unfortunately isn’t the Bitnami recommended method for installing custom PHP applications on top of a LAMP stack. Can you check the next guide and install WordPress using the recommend method to see if you reproduce the issue?

Apart from that, can you tell us what is the ownership of the files before you run the mentioned commands? I see in the configuration that Apache is configured to be run as the daemon user and group, so the files should belong to daemon when uploaded from the WordPress admin panel

$ grep daemon apache2/conf/httpd.conf
User daemon
Group daemon

It appears my set up is correct, according to the links docs:

To make a single PHP application accessible at the root URL of the Web server (for example, http://localhost ), simply copy the PHP files into the /opt/bitnami/apache2/htdocs folder.

We are not using Bitnami’s WordPress stack so I’m not sure what difference it would make to create a WordPress directory as a custom app?

What are the correct permissions for the LAMP folder and directories?

bitnami owns the htdocs folder but the daemon is the owner of all the directories and subfolders inside htdocs.

Hi @cbcjock,

Thanks for your message. I thought you were using an image with the approach A. The ownership of WordPress files should be bitnami:daemon to be properly serve by Apache. Can you run the next commands to update the ownership?

sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs
sudo chmod -R g+w /opt/bitnami/apache2/htdocs

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.