Media folder throws 500 only (AWS lightsail)


are there some known issues with Amazons Lightsail hosting service and Kirby? Uploaded a fresh copy of Kirby V3 into it and it displays everything correct besides the images. Here the URL:

I was just to play around with it for the first time.

Thanks in advance!

Its a permissions issue… do a view source on the page and click on one of the images. it will throw a kirby whoops.

The directory "/opt/bitnami/apache2/htdocs/media/pages" cannot be created

Kirby uses this folder to create thumbnails. Perhaps you uploaded the files with a user that differs from Apache, preventing it from creating the folder.

Hm, yes. Thought of that, but I just extracted the files on my download folder and uploaded them directly. Strange.

Yes but depending on how the server is configured, when you SFTP with a different account to the permissions that Apache has, it can cause issues, since those file permissions belong to the SFTP account.

You will probably need to chown the files & folders to the apache user & group over SSH to fix it.

Yes, changing the folder media to 777 helped. Solved.

Thank you!

Thats a bad idea! thats full permissions. I would come down a little bit and try 775 or 755.

777 give anyone full permission, so if it gets compromised they can go to town on your files. if you have only done it on the Media fold though, I guess its ok.

Yes, I forgot to write that I de-escalated the permissions. :slight_smile:

775 or 755 works, too.

Ok, now the panel does not work.

The session storage directory “/opt/bitnami/apache2/htdocs/site/sessions” is not writable

Guess I have to search for more permissions issues…

Theres probably quite a few. I normally deploy Kirby via rSync using a user that has the correct permission. It avoids this dance :slight_smile:

Yes, going to wipe it all and try to upload the zip-file and go from there.

rsync -az --force --delete --progress "ssh -p22" ./public/ YOURESUER@SERVERIPADDRESS:/var/www/vhosts/path/to/site

public is the local folder you want to sync with the remote. This way is best because it only transfers files that have changed after the first sync.

1 Like