Make new root page from panel redirects to panel/site/add

hi!

i’ve encountered a strange error for the first time: when i make a new root page from the panel, i get redirected to website-url.com/panel/site/add, which displays a front-end error page.

the website is working on localhost and used to work on a shared hosting, now i moved it to a vps and i got this problem. to be clear subpages work nicely.

i think i still need to install one last php package maybe? i thought i had installed everything…

this is the installed packages:

  • php-common/stable,now 1:49 all [installed,automatic]
  • php-fpm/stable,now 1:7.0+49 all [installed]
  • php-mbstring/stable,now 1:7.0+49 all [installed]
  • php-xml/stable,now 1:7.0+49 all [installed]
  • php7.0-cli/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-common/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-curl/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed]
  • php7.0-fpm/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed]
  • php7.0-gd/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed]
  • php7.0-json/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-mbstring/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-opcache/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-readline/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]
  • php7.0-xml/stable,stable,now 7.0.27-0+deb9u1 amd64 [installed,automatic]

any idea?

thanks,
af

Do you only get this error when trying to create a root page but not when creating subpages?

Any errors in console?

i think you may have one or two things missing. heres a list of installed packages from my VPS (CentOs7). Not all are installed by default (I installed via EasyApache). I definaetly remember install mbstring, bcmath and i think zip manually after installing PHP 7 before Kirby fully functioned.

Please don’t blindly install stuff, go careful :slight_smile: Understand what it does before pressing buttons.

build
libc-client
pear
php-bcmath
php-bz2
php-calendar
php-cli
php-common
php-curl
php-dba
php-devel
php-enchant
php-exif
php-fileinfo
php-fpm
php-ftp
php-gd
php-gettext
php-gmp
php-iconv
php-imap
php-intl
php-ldap
php-litespeed
php-mbstring
php-mcrypt
php-memcache
php-memcached
php-mysqlnd
php-odbc
php-opcache
php-pdo
php-pgsql
php-posix
php-process
php-pspell
php-snmp
php-soap
php-sockets
php-tidy
php-xml
php-xmlrpc
php-zip
runtime

yes, only for root pages. subpages work.

here the nginx error log

2018/07/04 11:36:41 [error] 18316#18316: *24048 open() "xxx/panel/site/add" failed (2: No such file or directory), server: website.com, request: "GET /panel/site/add HTTP/1.1", host: "website.com", referrer: "https://website.com/panel/"

ouch yes will scan through it.

i’m using nginx w/ php-fmp, wonder if that makes such a difference… thanks!

re: nginx error posted above. i also wonder if there’s something wrong in my nginx config settings for kirby, which i mostly copy-pasted from a post i found on the forum some time ago:

root /var/www/website.com;
        index index.html index.php;

        server_name xxx;

	## kirby

	# don't hint these as folders
    	rewrite ^/(site|kirby|panel/app|panel/test)$ /error last;

	# block content
    	location ~ /(assets|content|site|kirby|thumbs) {
        	rewrite ^/(.*).(txt|md|mdown|yaml|yml|git.*)$ /error last;
    	}

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

	# panel links
	location /panel {
	  if (!-f $request_filename){
	    set $rule_0 1$rule_0;
	  }
	  if (!-d $request_filename){
	    set $rule_0 2$rule_0;
	  }
	  if ($rule_0 = "21"){
	    rewrite ^/panel/(.*) /panel/index.php last;
	  }
	}

	# prevent clients from accessing hidden files (starting with a dot)
	location ~ (?:^|/)\. {
		deny all;
	}

	location ^~ /.well-known/ {
		allow all;
	}

	# Prevent clients from accessing to backup/config/source files
	location ~ (?:\.(?:bak|config|ini|log|sh|inc|dist)|~)$ {
                deny all;
        }

        location ~* \.(svg|js|css|png|jpg|jpeg|gif|ico|woff|woff2|ttf|eot)$ {
                expires 1y;
        }

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
        }

	error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /var/www/andrefincato.info/html;
        }

	location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

I dont know much about NGINX, but from a quick google around, it looks like IF statements are bad practice. Maybe try the config posted over here.

1 Like

that nginx config made it!

thank you!

af