Installation issue – 500 Internal server error

Hey guys,

I’m having trouble with deploying a Kirby site to the server of a client. I’ve installed Kirby sites on different servers before, but I can’t figure out a solution to this one.

The client is in charge of his own (shared) servers via a provider and we don’t have access to the server configuration – only to the file system. They configured the web server after the server requirements listed in the Kirby installation documents. Also, they created a subfolder /www in the file system that is configured as document root.

I’ve deployed the site to the server and it gives me a 500 internal server error. It seems to have to do with the .htaccess file. It does neither work with the default configuration nor with “RewriteBase /”. When I delete the .htaccess file I get the Kirby error “This page is currently offline due to an unexpected error…”.

Can somebody help me please?

Yeah, sounds like an .htaccess/server configuration issue. Are you sure that mod_rewrite is enabled in the first place? Do you have any access to the server log files?

Thanks for the quick reply. Unfortunately, I don’t have access to the log files. I possibly need to check with the client again whether they configured the server correctly and mod_rewrite is enabled.

If you get an error when you remove the htaccess, please enable debugging to see what error you get. Because the home page at least should work without the htaccess file.

The error from the debug console is:
“The session storage directory is not writable” – does this come from the missing mod_rewrite module?

No, the session files are stored inside /site/sessions, therefore this folder must be writable by the webserver user. And other folders as well, like content, site/accounts, site/cache and the media folder.

So this has to do with file/folder rights and permissions and you can’t really do anything about it, unless you have SSH access to the server or the client’s hosting admin console.

Okay, I see. And could you explain what I could do if I had SSH access to the server or the admin console? Or what needs to be done by someone with access to set the writing rights correctly?

That would be really helpful.

There are two commands that are important here: chmod and chown, see also this bash script:

chown sets the file/folder ownership
chmod set the folder/file rights

www-data is the default Apache webserver user.

The script itself would have to be adapted for Kirby 3 folder names.

Usually this can also be set via FTP. If you have a client like Filezilla, Transmit or Cyberduck this is really easy: How to Change File and Folder Permissions via FTP Tutorial - SiteGround Tutorials

Thank you for your replies. That’s really helpful. I’ll try to set the permissions via FTP with chmod.
But as far as I understand, I can’t do the chown part of texnixe’s explanation via FTP – so that probably won’t do the trick, right?

That’s right. And please don’t set permissions to 777 to circumvent this problem.

Thanks again. I’ll try to get access to the server then in order to run the script you proposed.