replying to myself : if looking for answers, make sure that socket locations are the same… the default in docs /run/php-fpm-librenms.sock did not seem to work then I tried looking for answers and modified it ONLY in one place… I think i’m on track with this now.
I run on Deb with Nginx and I wasn’t really familiar with either of them before installing LibreNMS. I didn’t have to do anything really quirky with nginx configuration to get it to work. I’m reviewing the install information to see if I can make any sense of where this broke down for you –
The error sounds like it’s pretty obvious and should be a simple fix. LibreNMS can’t find the database. Did you verify mariadb is running? sudo systemctl status mariadb:
Status: “Taking your SQL requests now…”
Perhaps it’s a stupid question but have you verified that your librenms database exists with appropriate rights?
mysql -u root
MariaDB [(none)]> SHOW DATABASES;
MariaDB [(none)]> SHOW DATABASES;
±-------------------+
| Database |
±-------------------+
| information_schema |
| librenms |
| mysql |
| performance_schema |
±-------------------+
4 rows in set (0.090 sec)
verify that you have the librenms user:
SELECT user FROM mysql. user;
MariaDB [(none)]> SELECT user FROM mysql. user;
±---------+
| user |
±---------+
| fred |
| librenms |
| root |
±---------+
Double check permissions to the database for user librenms. I don’t know how to “check” but as far as I know there’s no harm in simply re-running the command to ensure the rights are there:
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;
If that doesn’t make a difference did you enable a firewall? Maybe your vmware template for Debian has a firewall enabled that is blocking the connection? Finally, I’d worry a little about your nginx config now if you were tweaking on it.
default debian (well, the ‘+backports’ from minimal ‘netinstall’ dvd image). So no firewall by default.
I have, but I did it at first as the docs said -
(https://docs.librenms.org/Installation/Install-LibreNMS/) - it ended with ‘502 Bad Gateway’ error when i went to ‘install.php’ stage;
then I tried making it good either way (/var/run in both php-fpm and nginx config, then /run in both) and still it did not help - other than changing from ‘file not found’ to permission denied’ in the error.log;
Personally I never encountered anything unusual when I installed. Used a debian template I made for VMWare, just base and followed the instructions. I don’t recall ever having to tweak anything with PHP or anything unusual with nginx.
I don’t remember ever putting that configuration line into nginx. I’ll have to review the install instructions to see how it lands there
edit again: it’s this section in configuration instructions:
Configure PHP-FPM
> cp /etc/php/7.3/fpm/pool.d/www.conf /etc/php/7.3/fpm/pool.d/librenms.conf
> vi /etc/php/7.3/fpm/pool.d/librenms.conf
> ```
>
> ```
> # Change "www" to "librenms"
> [librenms]
>
> # Change user and group to "librenms"
> user = librenms
> group = librenms
>
> # Change listen to a unique name
> listen = /run/php-fpm-librenms.sock
> ```
root@nooty:/var/run/php# ls -l
total 4
-rw-r--r-- 1 root root 5 Aug 28 16:18 php7.3-fpm.pid
srw-rw---- 1 librenms librenms 0 Aug 28 16:18 php7.3-fpm.sock
these are created when the php7.4-fpm service is running. so …
i got back into /etc/php/7.3/fpm/pool.d/librenms.conf and turned listen-owner and listen-data back to www-data…
and i seem to be getting somewhere now (connecting by IP /install.php, it shows more steps - bacck in a bit