Jump to content

Permissions on AWS wont let processwire create files/folders

Recommended Posts

Hello, i recently migrated my project from a shared hosting to an amazon lightsail instance, it was fairly easy thanks to the duplicator module, but since i moved to the new server ive been having problems with the tight permissions of AWS, since the begining any time processwire was trying to write files in storage it was throwing a "permission denied" error, looking around i found a soultion to change the permissions via ssh with this:

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

(bitnami is the default username that comes with the LAMP installation that comes with lightsail) 

in the begining this worked fine but then i noticed from time to time the error was coming back at random times (it seems to me everytime processwire creates a new folder in the temp folder, it is created by default with the ownership like bitnami:bitnami instead of bitnami:daemon, but i havent been able to prove this)

So now im thinking of running the ssh command every minute to stop this, but i dont think this will be very reliable and would like to know if there is any other way to change the permissions permanently so that any new folder created has the right permissions, or maybe im getting everything wrong and i should do something else, never really worked with ssh or file permissions before so i might be really off on this, hope someone here has had experience with this before, thank!

Share this post

Link to post
Share on other sites

ok, i thik  found the solution just in case anybody else has this problem, the first time i made the backup recovery using the install.php file from the duplicator backup, at the time i didnt know about the commands to change the user credentials i described in the original post, so the only way i was able to get permissions was using a ssh tunnel and accesed to the file using localhost:8888/install.php, this way every file was attributed to bitnami, but then when frontend users tried to save images their user daemon was not allowed to edit files or folders made by bitnami

So the solution is to use the ssh commands to change the permissions and authors BEFORE using the installer.php, this might also be true when trying to use the root installer of processwire, i dont know but if anyone else runs into this problem this might help, thanks to everyone who didn't replied, please leave me a middle finger if you read this 

  • Like 1

Share this post

Link to post
Share on other sites

Hello! its me again, so in the end it didint work, after some days the error is back, any attemp at creating new files turns into an error until i go into ssh and change the permissions for all files again, any attemp includes when users try to view an image that has not the thumbnail size created yet, processwire attemps to creat the thumbnail and there comes the error, so the error is almost anywhre in the page where there are images loaded, the error im getting is this one:

Unable to create temp dir: /opt/bitnami/apache2/htdocs/site/assets/cache/WireTempDir/.PFM0.52373300T1574384522RyRV5wmiGO8N23/L1-L2-L3-L4/ en /opt/bitnami/apache2/htdocs/wire/core/WireTempDir.php linea 173

if anyone knows anything about this please help!

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...