Giter Site home page Giter Site logo

Comments (9)

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

OK, I've now tried hacking the index.php file to get something working temporarily, and set PIWIK_DOCUMENT_ROOT to /var/www/mysite, PIWIK_INCLUDE_PATH to /usr/share/matomo, and PIWIK_USER_PATH to /etc/matomo.

However, I now get this error:

Matomo encoutered an error: An exception has been thrown during the rendering of a template ("The ui asset with 'href' = /var/www/mysite/plugins/Morpheus/stylesheets/base/bootstrap.css is not readable"). (which lead to: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO))

So, I still can't figure out any way to get this application to run...

from matomo-package.

aureq avatar aureq commented on July 2, 2024

@Dreamsorcerer

  • Don't hack index.php. I mean, that's not going to help you in any way.
  • Could you provide more details on how you are trying to install Matomo
  • Could you provide more information about your environment
  • Could you provide your nginx configuration related to Matomo

Guessing what could be wrong without the above is going to be really hard for anyone.

Thanks

from matomo-package.

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

Well, I was more looking for a general idea of how someone is supposed to run/install it. Based on the instructions, I have installed the package, and then setup a database. From there, I can't seem to find any clear instructions on how this is supposed to be configured/run (obviously there is an Apache config in the package, but that doesn't seem to be helping me figure it out).

Here's one version of my nginx conf (I've tried a couple of different approaches):

server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	server_name mysite;
	root /usr/share/matomo;

	include fastcgi.conf;

	location / {
		try_files $uri @var;
	}

	location @var {
		root /var/www/mysite;
		try_files $uri /index.php?$query_string;
	}

	location = /index.php {
		fastcgi_pass php;
	}
}

For comparison, to understand what I am expecting to do, if you install the wordpress package, it comes with a custom config.php which automatically loads individual site configs from /etc/wordpress/, and then in that site config, you would define WP_CONTENT_DIR as /var/www/mysite/. That way, everything just works by getting nginx to run WordPress from /usr/share/wordpress/ and WordPress automatically loads plugins/themes etc. through the /var directory.

Literally everything I've tried seems to result in Matomo wanting me to allow it write access to /usr/share/matomo/ and to run everything from there.

from matomo-package.

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

So, for the record, instructions that I've been following: http://debian.piwik.org/
After installing the package, it says 'Check the configuration files in /etc/matomo/'.
No information on what I should be checking or what I might want to change. And, that's the end of those instructions, so I have no information on how I might run the project.

Finding these instructions in the README: https://github.com/matomo-org/matomo-package/blob/master/debian/README.Debian
That asks me to setup a database.
Then adds an Apache config.
But, as far as I can tell that config is just telling it to run through /usr/share/matomo/ which is what I've tried, and keeps giving me errors because it's not writeable.

from matomo-package.

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

I'm still rather lost, any hints on how it's supposed to work would be great. The only way I can imagine at this point is using some kind of overlayfs setup, using /usr/share/matomo as a read-only layer and then having a writeable layer on top of that.

Other than that, I'm completely lost as to how someone is supposed to run Matomo from this package...

from matomo-package.

florianjacob avatar florianjacob commented on July 2, 2024

Small hints hoping they could be useful: The canonical way to change stuff like PIWIK_USER_PATH is a bootstrap.php file, see https://matomo.org/docs/include-piwik-in-your-project/#bootstrap-php-execute-custom-code-before-matomo-runs for more info. That way, you don't have to modify index.php.

e.g. something like this:

<?php
// set PIWIK_USER_PATH to a writable location
define('PIWIK_USER_PATH', '/var/www/mysite');

(adapted from the NixOS package I maintain, so I can't give you specific info on this Debian package)

Also, the @var location should be removed, as none of the files in PIWIK_USER_PATH are intended to be served to users through the web server, they're only config and tmp files, read / writte by the php scripts in the /usr location.

from matomo-package.

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

Thanks so much @florianjacob, that gets it working.

@aureq Looking at how the package installs, I'm guessing the Debian package intends everything to be run out of /etc/matomo, rather than a /var/www/ site. However, without me adding the bootstrap.php file, it will only try to run from /usr/share/matomo. Obviously, manually adding bootstrap.php is another hack, so it seems to me that the package is missing this file, which should be hardcoded to /etc/matomo (if that's how the Debian package is meant to be run), or otherwise include a file from /etc/matomo/ to allow the user to customise the path.

from matomo-package.

Dreamsorcerer avatar Dreamsorcerer commented on July 2, 2024

Another error now, when downloading the geoip2 databases; it wants to save them to /usr/share/matomo/misc/. So, either Matomo should be tweaked to download them somewhere under the user_path, or if it must use that location, then that directory should be a symlink to somewhere in the user_path.

from matomo-package.

mattab avatar mattab commented on July 2, 2024

Thanks for your patience, let's continue the discussion in this other issue for now, where we're looking for a new maintainer for the debian package: #131

from matomo-package.

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.