fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.36k stars 343 forks source link

Readme / Config cleanup #1209

Closed Feldunost closed 4 years ago

Feldunost commented 4 years ago

Hello,

I'm trying to set-up a server and I tried multiple ways as the following:

Debian 10 netinstall + Apache2 + Php7.3 + Php-FPM + Postgresql Debian 10 netinstall + Nginx + Php7.3 + Php-FPM + Postgresql

I was only able to access once on http :80 everything else didn't work. There are too much config files and I'm unable to follow a simple guide out there.

Either a simple install /var/www/html Or a double install on 2 folders /var/www/html/folder1 and /var/www/html/folder2 I'm using 2.8 version of selfoss, but i heard there is a 2.9 ?

I think it needs a cleanup and a proper install guide.

jtojnar commented 4 years ago

Hello,

With Apache, the installation of selfoss should just be copying the contents of selfoss zip file to the /var/www/html.

Of course, you need some pre-requisites like enabling mod_rewrite in .htaccess by adding AllowOverrides to the Apache config, see https://www.digitalocean.com/community/tutorials/how-to-rewrite-urls-with-mod-rewrite-for-apache-on-debian-10- and set up Apache so it can use PHP. Not sure how to do that with PHP-fpm – with Apache mod_php is usually chosen, see https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10#step-3-%E2%80%94-installing-php

With nginx, either of the configs shown on wiki (e.g. https://github.com/SSilence/selfoss/wiki/nginx-configuration) should work, but you will need to double check all the paths since different Linux distributions use different paths and we cannot mention all of them.

The current stable version is 2.18 but we offer development previews of 2.19 with many bug fixes and

Feldunost commented 4 years ago

Hello,

Thanks for the reply, currently trying with nginx config on a Debian 10.

It seems it now uses www-data:www-data as main user & group instead of nginx:nginx as i knew it to be the norm. It's fine i left it as www-data on configs both nginx and php-fpm.

I am still unable to make it work properly even with that config : https://github.com/SSilence/selfoss/wiki/nginx-configuration I am sure it's about PHP / Nginx that gets a faulty configuration.

Can u test it out and see with debian amd64 netinstall ?

Feldunost commented 4 years ago

I'm quite lost with config files (which one shoud i use ?) : /etc/nginx/conf.d/default.conf /etc/nginx/sites-enabled/default

Thoses are straightforward and easily understandable: /etc/php/7.3/fpm/php.ini /etc/php/7.3/fpm/pool.d/www.conf

On my own html pages : https://192.168.1.107/index.html It serves correctly on https a simple page i crafted.

If I put https://192.168.1.107/veille/index.php Doesn't works it gives this error : 2020/07/28 16:03:47 [error] 1575#1575: *5 FastCGI sent in stderr: "PHP message: HTTP 404 (GET /index.php)PHP message: [veille/index.php:57] Base->run()" while reading response header from upstream, client: 192.168.1.101, server: 192.168.1.107, request: "GET /veille/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "192.168.1.107"

If I put https://192.168.1.107/veille/ It shows this error : Une erreur est survenue. Veuillez consulter le fichier « /var/www/html/veille/src/../data/logs/default.log ». And in logs : 2020/07/28 16:02:14 [error] 1575#1575: *3 FastCGI sent in stderr: "PHP message: Class daos\psql\Items does not exist [/var/www/html/veille/vendor/level-2/dice/Dice.php:80]PHP message: [veille/vendor/level-2/dice/Dice.php:80] ReflectionClass->__construct()PHP message: [veille/vendor/level-2/dice/Dice.php:66] Dice\Dice->getClosure()PHP message: [veille/vendor/level-2/dice/Dice.php:140] Dice\Dice->create()PHP message: [veille/vendor/level-2/dice/Dice.php:182] Dice\Dice->expand()PHP message: [veille/vendor/level-2/dice/Dice.php:95] Dice\Dice->Dice\{closure}()PHP message: [veille/vendor/level-2/dice/Dice.php:69] Dice\Dice->Dice\{closure}()PHP message: [veille/vendor/level-2/dice/Dice.php:182] Dice\Dice->create()PHP message: [veille/vendor/level-2/dice/Dice.php:100] Dice\Dice->Dice\{closure}()PHP message: [veille/vendor/level-2/dice/Dice.php:69] Dice\Dice->Dice\{closure}()PHP message: [veille/src/common.php:164] Dice\Dice->create()PHP message: [veille/index.php:57] Base->run()" while reading response header from upstream, client: 192.168.1.101, server: 192.168.1.107, request: "GET /veille/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "192.168.1.107"

U need to be in : https://192.168.1.107/veille/index.html In order to show the website ... with one error : Erreur de chargement : parsererror SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data And keep loading forever.

This error leads to the following logs : `[2020-07-28 17:17:49] selfoss.ERROR: Class daos\psql\Items does not exist {"exception":"[object] (ReflectionException(code: -1): Class daos\psql\Items does not exist at /var/www/html/veille/vendor/level-2/dice/Dice.php:80) [stacktrace]

0 /var/www/html/veille/vendor/level-2/dice/Dice.php(80): ReflectionClass->__construct('daos\\psql\\Items')

1 /var/www/html/veille/vendor/level-2/dice/Dice.php(66): Dice\Dice->getClosure('daos\\psql\\Items', Array)

2 /var/www/html/veille/vendor/level-2/dice/Dice.php(140): Dice\Dice->create('daos\\psql\\Items', Array)

3 /var/www/html/veille/vendor/level-2/dice/Dice.php(182): Dice\Dice->expand(Array, Array, true)

4 /var/www/html/veille/vendor/level-2/dice/Dice.php(95): Dice\Dice->Dice\{closure}(Array, Array)

5 /var/www/html/veille/vendor/level-2/dice/Dice.php(69): Dice\Dice->Dice\{closure}(Array, Array)

6 /var/www/html/veille/vendor/level-2/dice/Dice.php(182): Dice\Dice->create('daos\\Items', Array, Array)

7 /var/www/html/veille/vendor/level-2/dice/Dice.php(100): Dice\Dice->Dice\{closure}(Array, Array)

8 /var/www/html/veille/vendor/level-2/dice/Dice.php(69): Dice\Dice->Dice\{closure}(Array, Array)

9 /var/www/html/veille/src/common.php(164): Dice\Dice->create('controllers\\Ind...')

10 /var/www/html/veille/vendor/bcosca/fatfree-core/base.php(1864): {closure}('controllers\\Ind...', Array)

11 /var/www/html/veille/vendor/bcosca/fatfree-core/base.php(1898): Base->grab('controllers\\Ind...', Array)

12 /var/www/html/veille/vendor/bcosca/fatfree-core/base.php(1727): Base->call('controllers\\Ind...', Array, 'beforeroute,aft...')

13 /var/www/html/veille/index.php(57): Base->run()

14 {main}

"} `

Current testing configuration: /etc/nginx/sites-enabled/default

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name  192.168.1.107;
    ssl on;
    root /var/www/html;
    ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
    ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        try_files $uri $uri/ =404;
        index  index.php index.html index.htm;
    }

    location /veille {
        access_log /var/log/nginx/veille.access.log;
        error_log /var/log/nginx/veille.error.log;
        location ~ \.php$ {
            fastcgi_pass unix:/run/php/php7.3-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }
        location ~ ^/veille/((favicons|thumbnails)/.+)$ {
            try_files /veille/data/$1 =404;
        }
        location ~ ^/veille/$ {
            index index.php;
        }
        location ~ ^/veille/(.+)$ {
            try_files /veille/public/$1 /veille/index.php$is_args$args;
        }
    }

    location /veillator {
        access_log /var/log/nginx/veillator.access.log;
        error_log /var/log/nginx/veillator.error.log;
        location ~ \.php$ {
            fastcgi_pass unix:/run/php/php7.3-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }
        location ~ ^/veillator/((favicons|thumbnails)/.+)$ {
            try_files /veillator/data/$1 =404;
        }
        location ~ ^/veillator/$ {
            index index.php;
        }
        location ~ ^/veillator/(.+)$ {
            try_files /veillator/public/$1 /veillator/index.php$is_args$args;
        }
    }

    location ~ \.php$ {
        root           //html;
        try_files      $uri =404;
        fastcgi_index  index.php;
        fastcgi_pass   unix:/run/php/php7.3-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
}

Either on Apache or Nginx i get this on logs (/var/www/html/veille/data/logs/default.log): [2020-07-28 17:10:55] selfoss.ERROR: HTTP 404 (GET /index.php)

Feldunost commented 4 years ago

Fixed, was simply the following changes to do :

/etc/apache2/sites-enabled/000-default.conf add before end:

<Directory /var/www/html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Thanks to : https://www.vultr.com/docs/how-to-install-selfoss-rss-reader-on-a-debian-9-lamp-vps