Hi. I fell in love with the idea of having an open source alternative to Google Analytics, but I can’t materialize that dream because I can’t install Matomo.
I’m trying to do so in the same server as my Ghost blog. The blog is small, hosted at the free tier virtual machine that Amazon Web Services provides. There, I setup a machine with Ubuntu 18.04LTS, and have successfully made the website run with a valid SSL certificate. Broadly, that’s my situation.
Now, regarding Matomo, I figured that Nginx was a good bet because Ghost uses it. I think this also limits the memory and CPU usage of my measly machine. This is also why I have not used Docker or some other automatic installation app. Note that I’m aware I will need extra space in the future.
So what is the problem? I unzipped the Matomo files at /var/www/html, /var/www/, and my Ghost theme’s asset folder (which I guess wouldn’t be pertinent to you, but maybe), each in different attempts to get the Matomo installation website, and nothing. I get a 404 error.
I went step by step through the Nginx Matomo Github guide, and did everything except two steps. Those steps, I suspect, may be the issue.
The first step I couldn’t follow is configuring PHP. The Nginx Matomo Github guide says this step depends on my OS and PHP setup. Sure, but I don’t know the specific implications that having Ubuntu 18.04LTS, PHP 7.0.33, or Ghost 3.31.1has on the PHP configuration. The guide says I am probably using fastcgi_pass. Apparently, this requires php-fpm, which I didn’t have installed. This means Ghost, through Nginx, uses some other way to process PHP, right?
I tried to fix this by installing php-fpm and modifying the Nginx folders. The folder modifications were done following these steps*. Those steps, however were only half-done, because I was never able to create the elusive .sock file. It’s as if php-fpm really isn’t the way to go, given the usual Ghost and Nginx installation. What do you think? Given my Ghost and Nginx installation, how should I perform the PHP-configuration step?
The other step: restarting systemctl
This step may be a silly fix, or maybe it will lead me to another rabbit hole, just like the PHP configuration step. The thing is, it so happens that I cannot do the
sudo systemctl restart command. My console tells me there are too few arguments. My guess is this isn’t as important as the above step. But I may be wrong.
It may be pertinent to say that my website used to work well up to a couple of minutes ago, when I was tinkering with the Nginx and php-fpm files. When I come back to this, I’ll try to first get my blog back on its own (perhaps having to do a clean install…) before tinkering further with Nginx, Ghost, and Matomo.
*Please note that by this point I had already modified the matomo.conf files as per the Nginx Matomo Github guide up to the PHP step, of course excluding the PHP step.