UPDATE:
I found I was making a mistake when setting the file & folder permissions, and had accidentally been setting the folders to 644 as well (causing the site to crash). When the files & folders were set properly, everything worked perfectly.
New issue however – Azure’s servers are now resetting the file permissions within a few minutes of me changing them. Is there anything I can do to fix this?
OLD ISSUE:
I recently moved my website to a Microsoft Azure Web App running wordpress, using the default settings provided by Microsoft for the setup. The app runs without any issues, however while in SSH/FTP I noticed that all of the wordpress files and folders are owned by nginx and have 777 permissions. As this seems to be a security risk, I changed the folder permissions to 755 (no issue) and the file permission to 644 – but the site refuses to even open without the permissions set to 777. Is this a security risk, and if so, what can I do to secure my wordpress site on Azure?
I tried to change the file permissions via SSH to 644, causing the wordpress site to no longer load
2
Answers
It’s concerning that changing the file permissions to 644 causes your WordPress site to stop loading. This indicates that some files or directories might require additional permissions to function properly.
Here I have set the permissions accordingly, You can see the below command to change the permission.
If you want to apply this permission recursively to all subdirectories and files within the specified directory, you can add the
-R
optionchmod -R 755 directory_name
.Assuming you’re using the app setting
WEBSITES_ENABLE_APP_SERVICE_STORAGE
, this is expected behavior and cannot be changed:(Source)