Coder Social home page Coder Social logo

Piwik returns a blank page about docker HOT 9 CLOSED

matomo-org avatar matomo-org commented on August 29, 2024
Piwik returns a blank page

from docker.

Comments (9)

guiniol avatar guiniol commented on August 29, 2024

I added fastcgi_intercept_errors on to the nginx conf and php_flag[display_errors] = on to php-fpm, and I still get a blank page, so I have no idea what is going on...
If anyone has a working installation, I would appreciate the docker commandline and whatever conf files are necessary (only for the piwik container).

from docker.

pierreozoux avatar pierreozoux commented on August 29, 2024

Hi!

I have a working installation here: https://github.com/indiehosters/piwik

Indeed, after the first start, you have to follow the steps in the webUI to create the configuration file. This would be a nice to have but we didn't implemented yet. Feel free to PR :)

I close the issue, as I'm sure it will solve it, but feel free to reopen if necessary.

from docker.

guiniol avatar guiniol commented on August 29, 2024

Hey!

I'll try again with the indiehoster configuration.
The webUI is at index.php, right?

from docker.

guiniol avatar guiniol commented on August 29, 2024

Quick question: why do you add to nginx

volumes_from:
  - app

Is it only for the ssmtp configuration, or is ./config:/var/www/html/config also necessary?

from docker.

pierreozoux avatar pierreozoux commented on August 29, 2024

On 20-06-2016 09:21, guiniol wrote:

Quick question: why do you add

|volumes_from: - app |
I usually do that. It is for nginx to server static assets, but I'm not
sure in the case of piwik it is really helpful

Is it only for the ssmtp configuration, or is
|./config:/var/www/html/config| also necessary?
Nginx doesn't need either ssmtp nor config actually


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#30 (comment), or
mute the thread
https://github.com/notifications/unsubscribe/ABxvHSQ1-ETh-oh8fD7ijwvgpOTKhTJYks5qNk2MgaJpZM4I5M8E.

I use PGP to protect our privacy, if you want to know more, you can
follow this
https://emailselfdefense.fsf.org/en/

If you have further questions, please do not hesitate to ask.
You can verify my public key here: https://keybase.io/pierreozoux

from docker.

pierreozoux avatar pierreozoux commented on August 29, 2024

And yes, index.php or /

from docker.

guiniol avatar guiniol commented on August 29, 2024

And yes, index.php or /

Ok, thanks.

volumes_from: - app
I usually do that. It is for nginx to server static assets, but I'm not sure in the case of piwik it is really helpful

In this case, it is only ./config:/var/www/html/config, so I'm not sure there are any static assets to serve.

from docker.

guiniol avatar guiniol commented on August 29, 2024

So...
I finally got it to work. I made two mistakes:

  1. I used the nginx:alpine version (smaller footprint), but there are stuff missing for piwik.
  2. volumes-from also includes the implicit volumes (in particular /var/www/html), so that nginx can find the non php files.

I hope my mistakes can help someone else not waste so much time.

from docker.

ishtiaque06 avatar ishtiaque06 commented on August 29, 2024

Hello,

I have been trying to make Matomo work with my existing docker-compose setup with nginx. The issue I'm facing is exactly the same as this but I feel like I'm still missing something from the discussion above.

My situation's this: my site is currently at subdomain.example.com and it works perfectly fine with the current setup. However, I want to direct all requests to subdomain.example.com/analytics/* to the Matomo instance that I'm trying to spin up. I have successfully been able to run docker-compose up and fire up all the containers properly. However, when I go to subdomain.example.com/analytics/, I get a blank page with a literal string "File not found" as this issue talks about.

Here are the relevant parts of my nginx.conf file:

upstream backend {
  server matomo:9000;
}

server {
  client_max_body_size 10M;
  server_name *.example.com;

  listen 443 ssl; # managed by Certbot
  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

  gzip on;
  gzip_types      text/plain application/xml;
  gzip_proxied    no-cache no-store private expired auth;
  gzip_min_length 1000;

  location /analytics/ {
    rewrite /analytics/(.*)$ /$1 break;
    include fastcgi_params;
    fastcgi_pass dibs_matomo;
    fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
    fastcgi_param  SERVER_SOFTWARE    nginx;
    fastcgi_param  QUERY_STRING       $query_string;
    fastcgi_param  REQUEST_METHOD     $request_method;
    fastcgi_param  CONTENT_TYPE       $content_type;
    fastcgi_param  CONTENT_LENGTH     $content_length;
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  REQUEST_URI        $request_uri;
    fastcgi_param  DOCUMENT_URI       $document_uri;
    fastcgi_param  DOCUMENT_ROOT      $document_root;
    fastcgi_param  SERVER_PROTOCOL    $server_protocol;
    fastcgi_param  REMOTE_ADDR        $remote_addr;
    fastcgi_param  REMOTE_PORT        $remote_port;
    fastcgi_param  SERVER_ADDR        $server_addr;
    fastcgi_param  SERVER_PORT        $server_port;
    fastcgi_param  SERVER_NAME        $server_name;
    fastcgi_intercept_errors on;
    fastcgi_read_timeout 300;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    
}

Relevant parts of my docker-compose.yml (some definitions removed for brevity):

services:
  nginx:
    image: nginx
    volumes:
      - static_volume:/usr/src/app/static
      - media_volume:/usr/src/app/media
      - ./nginx:/etc/nginx/conf.d
      - ./certbot/conf:/etc/letsencrypt
      - ./certbot/www:/var/www/certbot
      - ./matomo-config:/var/www/html/config:rw
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - gunicorn
      - certbot
  matomo:
    image: matomo:fpm-alpine
    depends_on:
      - matomo_database
    volumes:
      - ./matomo-config:/var/www/html/config:rw
    expose:
      - 9000
    environment:
      *common-variables

  matomo_database:
    image: yobasystems/alpine-mariadb
    volumes:
      - /data/example/mysql:/var/lib/mysql
    # command: mysqld --innodb-buffer-pool-size=10M
    environment:
      *common-variables

I can give more details if necessary. I'm also pasting the logs I get when I make a request to subdomain.example.com/analytics/.

matomo_1           | 192.168.48.10 -  29/May/2019:12:14:08 +0000 "GET /" 404
nginx_1            | 2019/05/29 12:14:08 [error] 9#9: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 165.82.203.83, server: *.example.com, request: "GET /analytics/ HTTP/1.1", upstream: "fastcgi://192.168.48.6:9000", host: "subdomain.example.com"
nginx_1            | xxx.xxx.xxx.xxx - - [29/May/2019:12:14:08 +0000] "GET /analytics/ HTTP/1.1" 404 47 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0"

Any help would be much appreciated!

Thank you.

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.