Williams A.
Williams A.

Reputation: 743

AWS EC2 Ubuntu File permissions issue

I'm running a EC2 instance with:

Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-119-generic x86_64) Bitnami LAMP 5.6.30-5

My problem

I have a Wordpress site that isn't working very well on the backend, so I decided to update and I get an error "Can not create the directory..." when updating. So I did a research and it's related to file permissions. So I get to this conclusion:

I having the following issues with the file permissions:

I tried

How to solve this?

I tried all that and also giving the owner to root:root, www-data:www-data and bitnami:bitnami.

If someone knows the original user and group owner of the /htdocs folder I could try a test, but I forgot.

I would appreciate if anyone can help me to solve this. I just want to be able to write/edit files from server side.

Many thanks.

Upvotes: 1

Views: 2028

Answers (1)

Williams A.
Williams A.

Reputation: 743

I solved this by doing the following:

  1. Set htdocs owner to bitnami:bitnami

sudo chown -R bitnami:bitnami htdocs/

  1. Inside /htdocs, changed file and directories owner to bitnami:daemon

sudo chown -R bitnami:daemon

  1. Changed files and directories permissions

sudo find * -type d -print0 | xargs -0 chmod 0755 # for directories

sudo find . -type f -print0 | xargs -0 chmod 0644 # for files

  1. Changed wp-content directories permissions to 775

sudo find wp-content/ -type d -exec chmod 0775 {} \;

And with that now I'm able to edit and upload via FTP and in the WP admin dashboard.

Upvotes: 1

Related Questions