Fresh PROD Server Kirby CMS not working

Hello,
I bought the Erlega theme and created a site locally with it. Now I have installed my Kirby CMS on my server and the fields for the colours and the fontfamily are not loaded.

In addition, images are not displayed in panel.
And in the frontend the CSS and images do not load.

I am hosting this on ubuntu 23.10 with php8.2 installed and nginx.

Here are my php modules:

root@:/etc/php/8.2#  php -m
PHP Warning:  PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib/php/20220829/apcu.so (/usr/lib/php/20220829/apcu.so: undefined symbol: php_strlcpy), /usr/lib/php/20220829/apcu.so.so (/usr/lib/php/20220829/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imagick
intl
json
libxml
mbstring
memcached
msgpack
openssl
pcntl
pcre
PDO
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Here is my nginx config:

server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             www.transformative-philosophy.com;
    set                     $base /var/www/transformative-philosophy.com;
    root                    $base/html;

    # Rewrite rules
    rewrite ^/(content|site|kirby)/(.*)$ /error last;
    rewrite ^/\.(?!well-known/) /error last;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/transformative-philosophy.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/transformative-philosophy.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/transformative-philosophy.com/chain.pem;

    # security
    include                 nginxconfig.io/security.conf;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    error_log               /var/log/nginx/error.log warn;

    # index.php
    index                   index.php;

    # index.php fallback
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # additional config
    include nginxconfig.io/general.conf;

    # handle .php
    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
        include      nginxconfig.io/php_fastcgi.conf;
    }
}

# non-www, subdomains redirect
server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             .transformative-philosophy.com;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/transformative-philosophy.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/transformative-philosophy.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/transformative-philosophy.com/chain.pem;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    return                  301 https://www.transformative-philosophy.com$request_uri;
}

# HTTP redirect
server {
    listen      80;
    listen      [::]:80;
    server_name .transformative-philosophy.com;

    # logging
    access_log  /var/log/nginx/access.log combined buffer=512k flush=1m;
    include     nginxconfig.io/letsencrypt.conf;

    location / {
        return 301 https://www.transformative-philosophy.com$request_uri;
    }
}

Do you have any idea what could be the reason for this? I could really need some help, because this must go prod today.

looks like file permissions to me or missing files/folders.

Do the plugins actually show up in the system view?

Hey @Khepri.Design,

I just setup a new server and get this:

Which permissions do I have to set?
image

Hey @texnixe,

yes all the plugins showed up in panel and in directory

Hm the files and folders are owned by the root user, but your root user is likely not the web server user.

@texnixe

I just used the following to set permissions:

sudo chown -R www-data:www-data *

sudo find /var/www/ -type d -exec chmod 755 {} +
sudo find /var/www/ -type f -exec chmod 644 {} +

image

I can open the panel again. But the field and images in frotend are still not loading.

If you look in the media folder, can you see any images getting created there?

Yeah the images I have uploaded with the media folder:

That’s something you should not do, please remove the media folder and let it recreate. Then let’s hope Kirby can create it, otherwise you have to fix your permissions again.

I deleted the folder, should it be recreated automatically?

As I wrote above, yes, provided the server has the correct rights to create the folder.

Okay, I see, the folder was created automatically.

Can I copy my content folder from the local directory so that I don’t have to maintain all the content again?

Yes.

But the file you need for the plugins to work is not loaded:

The path does not exist:

This seems to be a server configuration issue, if I compare your nginx config file with the one here: Running Kirby on a Nginx web server | Kirby CMS, I see these lines missing:

  default_type text/plain;
  add_header X-Content-Type-Options nosniff;

Maybe try that

I have changed my conf to this:

server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             www.transformative-philosophy.com;
    set                     $base /var/www/transformative-philosophy.com;
    root                    $base/public;

    default_type text/plain;
    add_header X-Content-Type-Options nosniff;

    # Rewrite rules
    rewrite ^/(content|site|kirby)/(.*)$ /error last;
    rewrite ^/\.(?!well-known/) /error last;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/transformative-philosophy.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/transformative-philosophy.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/transformative-philosophy.com/chain.pem;

    # security
    include                 nginxconfig.io/security.conf;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    error_log               /var/log/nginx/error.log warn;

    # index.php
    index                   index.php;

    # index.php fallback
      location / {
        try_files $uri $uri/ /index.php$is_args$args;
      }

    # additional config
    include nginxconfig.io/general.conf;

    # handle .php
    location ~* \.php$ {
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
        include      nginxconfig.io/php_fastcgi.conf;
    }
}

# non-www, subdomains redirect
server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             .transformative-philosophy.com;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/transformative-philosophy.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/transformative-philosophy.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/transformative-philosophy.com/chain.pem;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    return                  301 https://www.transformative-philosophy.com$request_uri;
}

# HTTP redirect
server {
    listen      80;
    listen      [::]:80;
    server_name .transformative-philosophy.com;

    default_type text/plain;
    add_header X-Content-Type-Options nosniff;

    # logging
    access_log  /var/log/nginx/access.log combined buffer=512k flush=1m;
    include     nginxconfig.io/letsencrypt.conf;

    location / {
        return 301 https://www.transformative-philosophy.com$request_uri;
    }
}

No change

And restarted the server?

Yes, nginx.service and server.

Then I’m afraid I cannot help you. I suggest you google the error message, this is definitely a server configuration problem