Images, subpages and panel not working

  • Images, subpages and panel not working.
  • This is localhost with apache 2.4.29 and php 7.2.24
  • mbstring, curl, ctype, gd enabled
  • Adding gibberish to .htacesss (before the IfModule mod_rewrite.c tag) produces a 500 internal server error
  • var/www/html/ , var/www/html/starterkit and all subfolders are root/root drwxr-xr-x
  • All files are root/root -rw-r–r--
  • I tried with ‘RewriteBase /’ and ‘RewriteBase /starterkit’ to no avail
  • I also tried to serve the starterkit from a user directory at ~/public_html/starterkit whose .htaccess also produces a 500 internal server error if filled with gibberish, and whose folders and files have the same permissions although not root/root owned but user/user (user being my user)

… what’s left for me to try ?

Thank you

What is the error message in the server logs?

And what is your local environment?

If you are using PHP’s built-in server, you have to start it with Kirby’s router.php

php -S localhost:8000 kirby/router.php

I have a similar issue. The local version is working fine using php -S localhost:8000 kirby/router.php but showing error on the production server.

Does the media folder get created on the remote server? Make sure not to deploy your media folder, it gets recreated (or should get created) on the server.

Apache’s error.log shows ‘File does not exist’ entries for files and also for the panel

[Mon Nov 18 01:33:36.985620 2019] [core:info] [pid 4629] [client 127.0.0.1:49292] AH00128: File does not exist: /home/jaume/public_html/starterkit/media/pages/photography/plants/460365936-1574037194/nice-colors-ugly-plant-1024x1024.jpg, referer: http://localhost/~jaume/starterkit/

[Mon Nov 18 10:24:58.855112 2019] [core:info] [pid 955] [client 127.0.0.1:59570] AH00128: File does not exist: /var/www/html/starterkit/panel

@texnixe I am not running php’s built-in server but accessing the site via apache 2.4.29 as mentioned.

Actually… apache should have write access to some folders shouldn’t it ?

Thanks

Btw, there is no media folder in ‘/var/www/html/starterkit’ but there IS a media folder in ‘/home/myuser/starterkit’, this media folder is created and owned by www-data (apache user) but still no images or panel in either location.

I just tried adding www-data as group owner to the html folder recursively , and giving group write access to it also recursively. So now www-data should have write access to all of /html folder

That allowed apache to create a media folder there aswell, but, again, no images or panel.

/edit

I’ve checked permissions on an external HD rsync backup of a working local installation:

var/html/webdev drwxr-xr-x myuser/myuser
var/html/webdev/kirbyfolder drwxrwxr-x myuser/myuser
var/html/webdev/kirbyfolder/content and /media drwxrwxr-x myuser/www-data (apache)
rest of folders drwxrwxr-x myuser/myuser
non executable files -rw-rw-r-- myuser/myuser
executable files -rwxrwxr-x myuser/myuser

Which would mean it complied with 755/644 permissions AND had write permissions for apache on ‘content’ and ‘media’ folders.

No other hints there

edit/

I checked again php info and mbstring seems to be enabled.

I am confused… the pain… please help

Your Webserver (apache) needs write permissions on ‘site/accounts’ and ‘site/sessions’ folders too!

Ok thank you @anon77445132, I believe needed write permissions are not clearly stated in the guide are they?

But this does not seem to solve my problem. I already tried giving www-data group ownership to var/www/html/ recursively and gave the group +rwX also recursively.

So Apache should be able to read and write and navigate freely, but images, subpages and panel are not working.

Plus site/accounts and site/sessions do not exist in this installation!

Jesus, where did it go wrong!

I am going to start over.

Solution: mod_rewrite was not enabled