How to Enable WordPress Plugin Updates on AWS EC2 (Bitnami)

Trialing different ways to get my AWS EC2 instance (Bitnami AMI) working with Updating WordPress Plugins.

METHOD THAT WORKED

Performing cms below did the trick, however. Anyone more familiar with bitnami, please feel free to step in and clarify.

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

A7B3BBB8-139E-49AF-BC96-EAC809CDC4F6

Refs:
https://www.agileweboperations.com/migrate-your-wordpress-blog-to-a-bitnami-ec2-instance

Then Getting WP Total Cache to work

6ECB5BE1-811F-4299-B8DD-0CCDCBB2E0DF

62FDB9AF-E80F-40E4-8B31-7623CDC218E3

5F7BC2B5-A4BD-4916-B465-2B028FB7A50B

1D39AE76-F332-4758-836C-0BB78B5205E8

Done.

This breaks SSH

Image

“aws bitnami SSH using daemon group”

sudo usermod -a -G daemon bitnami

Works!

EFDAF48D-323E-4AD1-B216-BE02E2DACFF7

Done.


OTHER TRIED METHODS THAT DIDNT WORK…

I left owners as daemon:bitnami and set wp-content to 775 permissions. To get plugin updates to work, I also needed to add the following to wp-config.php:

define(‘FS_METHOD’, ‘direct’);
define( ‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/tmp/’);
And create the tmp directory under wp-content.

7F7A71A3-8033-4DF3-B0D8-C7A0AB538288

https://stackoverflow.com/questions/32906917/correct-permissions-for-bitnami-ec2-wordpress


WordPress plugin
SSH SFTP Updater Support
https://wordpress.org/plugins/ssh-sftp-updater-support/

More info: https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants


First, we want to change the ownership of the html folder…

$ sudo -i
$ cd /var/www
$ chown ec2-user:apache html

Next, we need to recursively change the ownership and permissions of WordPress’s files and folders…

$ cd /var/www/html
$ find . -type d -exec chmod 0755 {} \;
$ find . -type f -exec chmod 0644 {} \;
$ chown -R ec2-user:apache .
$ chmod -R g+w .
$ chmod g+s .

https://nouveauframework.org/blog/ultimate-guide-to-hosting-wordpress-on-aws-ec2-for-complete-beginners/


You can skip the FTP info altogether and just change the permission of the directory structure where WordPress is installed via SSH to allow Apache to be the owner instead of the root user:
sudo chown -R apache:apache path/to/wordpress

I tried this below and it broke permissions.

Change ownership of htdocs folder

sudo chown -R www-data:www-data /opt/bitnami/apps/wordpress/htdocs/

add user to group (that doesnt exist)

sudo useradd -G www-data bitnami

… user bitnami already exists …

add user to group (that exists)

(group name) (user name)
sudo usermod -a -G www-data bitnami

Errors:

Image

To revert this run this command

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

https://forums.aws.amazon.com/thread.jspa?messageID=600118

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *