0
votes

I setup SFTP on the EC2 Instance with Openlitespeed via Filezilla and it connects but I could not upload, delete or move files.

I then tried the solution suggested on this post: Amazon AWS Filezilla transfer permission denied

So for UBUNTU,

sudo chown -R ubuntu:ubuntu /var/www/html

sudo chmod -R 755 /var/www/html

This solved that problem but now wordpress is asking for FTP details to install a plugin and the config.php and .htaccess is no longer writable (enabling/disabling litespeed cache plugin).

So this has reset the permission for wordpress as well. Does anyone have the solution how to fix the wordpress permissions on the server?

Thank you in advance.

1

1 Answers

1
votes

you need to match the user that runs OLS/LSPHP

run grep -i "user" /usr/local/lsws/conf/httpd_config.conf to get the user that runs OLS , which I assume it should be www-data

then you need to chown -R www-data:www-data /var/www/html

after that, do :

find /var/www/html -type d -exec chmod 0755 {} \;

find /var/www/html -type f -exec chmod 0644 {} \;

to restore the file perm to 644, and dir perm to 755, as its previous status that ditrubted by your chmod -R 755 command.