Help need with nginx and permission error

When asking for help and support, please provide as much information as possible. This should include:

  • Steps to reproduce an issue.
  • The output of ./validate.php

If it’s an issue with the WebUI then please consider including a screenshot and the browser version you are using.

If you are having troubles with discovery/polling include the pastebin output of:

./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh

If you need to post any text longer than a few lines, please use a pastebin service such as https://p.libren.ms using non-expiring pastes.

Hello everyone,

I have some problem with installation of librenms. I followed all the installation process but the webGUI don’t fonction. It ends up with 502 bad Gateway sent from Nginx. I tried to go to the Ip of the server with /install at the end and without it but it doesn’t works. I am using php8.1 with nginx 1.18.

I checked the errors logs sent from nginx and it sent to me this :
2022/08/03 14:21:40 [crit] 19752#19752: *66 connect() to unix:/run/php/php-fpm-librenms.sock failed (13: Permission denied) while connecting to upstream, client: MyIp, server: ServerIP, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php-fpm-librenms.sock:”, host: “ServerIP”

I tried several browser but the same error appear again. I am on MacOS and the server is on a Virtual Machine Hosted in a VSphereCenter. If anyone can help me it’s a pleasure to answer question.

What is the output of:
ls -l /run/php/php-fpm-librenms.sock
and
systemctl status php-fpm

The output of ls -l /run/php/php-fpm-librenms.sock is :

srw-rw---- 1 librenms librenms 0 août   3 16:40 /run/php/php-fpm-librenms.sock
systemctl status php-fpm
Unit php-fpm.service could not be found.

There is a discrepancy in below section of documentation

as per the document listener setting is “listen = /run/php-fpm-librenms.sock”
it suppose to be “listen = /run/php/php-fpm-librenms.sock” ( extra /php in the path)

Please check this setting and restart php and nginx services

Sorry, it must be systemctl status php8.1-fpm or something (please find the appropriate service name if that is not correct)

Hmm, both points in the documentation say to set it to /run/php-fpm-librenms.sock
Aka:
listen = /run/php-fpm-librenms.sock in /etc/php/7.4/fpm/pool.d/librenms.conf
and
fastcgi_pass unix:/run/php-fpm-librenms.sock; in /etc/nginx/conf.d/librenms.conf

I do see that this user’s config is looking for /run/php/php-fpm-librenms.sock, so maybe they need to remove the extra /php/ somewhere.

WhiteeNightmare will go with this suggestion provided my murrant
find the correct service and check the status

The socket path is good. Nginx sent me a error he can’t access the socket

systemctl status php8.1-fpm
● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-08-09 14:59:53 CEST; 7min ago
Docs: man:php-fpm8.1(8)
Process: 856 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81 (code=exited, statu>
Main PID: 737 (php-fpm8.1)
Status: “Processes active: 0, idle: 4, Requests: 0, slow: 0, Traffic: 0req/sec”
Tasks: 5 (limit: 1033)
Memory: 28.9M
CPU: 123ms
CGroup: /system.slice/php8.1-fpm.service
├─737 “php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “”
├─850 “php-fpm: pool librenms” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “”>
├─851 “php-fpm: pool librenms” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “”>
├─852 “php-fpm: pool www” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” ">
└─855 “php-fpm: pool www” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” ">

août 09 14:59:52 tc-srv-librenms systemd[1]: Starting The PHP 8.1 FastCGI Process Manager…
août 09 14:59:53 tc-srv-librenms systemd[1]: Started The PHP 8.1 FastCGI Process Manager.

If i put all acces on www-data:www-data the web GUI work .

user and group should be librenms:librenms
Please check out put of below

cat /etc/php/8.1/fpm/pool.d/librenms.conf | egrep -v “;”

it should contain user and group settings as below

[librenms]

user = librenms
group = librenms