Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX Installation #62

Closed
felixbeer opened this issue Aug 27, 2019 · 14 comments
Closed

NGINX Installation #62

felixbeer opened this issue Aug 27, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@felixbeer
Copy link

System Info

  • PHP Version: PHP 7.3.5
  • XBackBone Version: XBackBone v2.6
  • Webserver: NGINX

After installing manually with sqlite i can't access the xbackbone/home url (Error 404).

When automatically installing there is a slim error:

Slim Application Error
The application could not run because of the following error after clicking install:

Details
Type: RuntimeException
Message: Named route does not exist for name: https://share.domain.com/install/
File: /var/www/domain.com/html/share/vendor/slim/slim/Slim/Router.php
Line: 296
Trace
#0 /var/www/domain.com/html/share/vendor/slim/slim/Slim/Router.php(381): Slim\Router->getNamedRoute('https://share.f...')
#1 /var/www/domain.com/html/share/vendor/slim/slim/Slim/Router.php(446): Slim\Router->relativePathFor('https://share.f...', Array, Array)
#2 /var/www/domain.com/html/share/app/helpers.php(131): Slim\Router->pathFor('https://share.f...', Array)
#3 /var/www/domain.com/html/share/app/helpers.php(98): route('https://share.f...', Array)
#4 /var/www/domain.com/html/share/install/index.php(253): redirect(Object(Slim\Http\Response), 'https://share.f...')
#5 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#6 /var/www/domain.com/html/share/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#7 /var/www/domain.com/html/share/vendor/slim/slim/Slim/Route.php(356): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#8 /var/www/domain.com/html/share/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#9 /var/www/domain.com/html/share/vendor/slim/slim/Slim/Route.php(334): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#10 /var/www/domain.com/html/share/vendor/slim/slim/Slim/App.php(515): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#11 /var/www/domain.com/html/share/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#12 /var/www/domain.com/html/share/vendor/slim/slim/Slim/App.php(405): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#13 /var/www/domain.com/html/share/vendor/slim/slim/Slim/App.php(313): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#14 /var/www/domain.com/html/share/install/index.php(309): Slim\App->run()
#15 {main}

Thanks for your help🙂

@felixbeer felixbeer changed the title NGINX Home not working NGINX Installation Aug 27, 2019
@sergix44
Copy link
Owner

By manually installing you mean install via cli or web installer?
Can you give the steps to reproduce the error?

@felixbeer
Copy link
Author

Manual/CLI:
wget release package 2.6
unzip
Rename and edit config file (baseurl and user login)
php bin/migrate --install
When then heading to /home there is a 404 error from nginx

Installer:
wget release package 2.6
unzip
Go to /install
Fill in user data and baseurl
When clicking Install then a new page opens with the same slim error as stated above

@sergix44
Copy link
Owner

Do you have adjusted the nginx configutation according to the file https://github.com/SergiX44/XBackBone/blob/master/nginx.conf?

When using CLI, try to remove deleting manually the install/ directory.

Thanks.

@felixbeer
Copy link
Author

Will try that in the evening, thanks!

@dirtycajunrice
Copy link

For nginx i have the same automatic slim error, but manually worked as expected. I did have to create the ./storage folder and touch the db file myself. (and permissions needed to be proper)

@felixbeer
Copy link
Author

@dirtycajunrice Thanks for the input! I touched the db file and made the directory storage. I also edited the nginx config to suit the XBackBone one. Now when entering the site after the cli installation it redirects to /login resulting in a 500 error. The nginx log says following:

Stack trace:
#0 /var/www/felix.beer/html/share/bootstrap/app.php(132): App\Web\Lang::recognize()
#1 /var/www/felix.beer/html/share/vendor/pimple/pimple/src/Pimple/Container.php(118): {closure}(Object(Slim\Container))
#2 /var/www/felix.beer/html/share/vendor/slim/slim/Slim/Container.php(123): Pimple\Container->offsetGet('lang')
#3 /var/www/felix.beer/html/share/bootstrap/app.php(152): Slim\Container->get('lang')
#4 /var/www/felix.beer/html/share/vendor/pimple/pimple/src/Pimple/Container.php(118): {closure}(Object(Slim\Container))
#5 /var/www/felix.beer/html/share/vendor/slim/slim/Slim/Container.php(123): Pimple\Container->offsetGet('view')
#6 /var/www/felix.beer/html/share/vendor/slim/slim/Slim/Container.php(172): Slim\Container->get('view')
#7 /var/www/felix.beer/html/share/bootstrap/app.php(166): Slim\Container->__get('view')
#8 [interna" while reading response header from upstream, client: <myIP>, server: ~^(?<subdomain>.+)\.felix\.beer$, request: "GET /login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "share.felix.beer"`

@dirtycajunrice
Copy link

dirtycajunrice commented Aug 29, 2019

@BeerGrizzly Hmm... Not sure. Lemme share with you my nginx config and my config.php and see if you have any odd differences. I also noticed you said you changed user login for the sqlite file in config.php (unless you are using mysql). Just leave it null.

nginx:

server {

    listen 443;

    root  /config/www/xbackbone;
    index index.html index.htm index.php;

    server_name images.domain.tld;

    ssl_certificate /config/keys/domain.tld/fullchain.pem;
    ssl_certificate_key /config/keys/domain.tld/privkey.pem;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    access_log            /config/log/nginx/xbackbone.access.log;
    error_log             /config/log/nginx/xbackbone.error.log;

    charset utf-8;

    error_page 404 /index.php;

    client_max_body_size 2G;

    include includes/dns_set;

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

    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }

    autoindex off;
    location ~ ^/(app|bin|bootstrap|resources|storage|vendor|logs) {
        return 403;
    }

  
}

config.php

<?php
return [
        'base_url' => 'https://images.domain.tld',
        'db' => [
                'connection' => 'sqlite',
                'dsn' => 'resources/database/xbackbone.db',
                'username' => null,
                'password' => null,
        ],
        'storage' => [
                'driver' => 'local',
                'path' => './storage',
        ],
];

@felixbeer
Copy link
Author

Thats weird, I mean i got the exact same nginx config (besides the fastcgi_pass configured to the php fpm socket) and xbackbone config.
Hopefully @sergix44 knows what to do 🙂

@dirtycajunrice
Copy link

also sergi that location block at the bottom might clean up the look of your example a bit 😄

@sergix44 sergix44 added the bug Something isn't working label Aug 29, 2019
@sergix44
Copy link
Owner

Please try to install it manually, and make sure that the extensions php-intl, php-sqlite and php-json are installed.
I've tested and some redirects in the web installer are broken, will fix that in the next patch.

@felixbeer
Copy link
Author

felixbeer commented Aug 29, 2019

Thanks a lot for the php-intl tip, didn't know it was needed. All working now👍

@sergix44
Copy link
Owner

I'll keep this open as reminder to fix the web installer.

@sergix44 sergix44 reopened this Aug 29, 2019
@felixbeer
Copy link
Author

Alright, sorry to come back with another error, after logging in when editing or creating a new user i get an Error (slim i suppose) showed in the image below:
chrome_7jIAYFhDg9

I made a chown to www-data user the whole directory of XBackBone so it can for sure access the database file but that didn't help

@sergix44
Copy link
Owner

sergix44 commented Aug 30, 2019

Can you provide the application logs in the log folder?
Open a new issue please with the attached logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants