I’m trying to install LibreNMS on a freshly installed Ubuntu 20.04 server, with all the updates.
After following the installation instructions carefully (https://docs.librenms.org/Installation/Install-LibreNMS/), with the Ubuntu 20.04 and NGINX options, I’m getting “502 Bad Gateway” error in the ‘Web installer’ section.
There is nothing in the ‘/etc/nginx/sites-enabled/’ directory, and in the ‘/etc/nginx/sites-available’ directory the only file is ‘default’.
Seems like some steps are missing from the ‘Configure Web Server’ section in the installation guide.
Good morning. Someone had a similar issue not long ago…It looks like you may have missed a few steps:
In /etc/php/7.4/fpm/pool.d - do you have a librenms.conf file? If not, do the following.
cp /etc/php/7.4/fpm/pool.d/www.conf /etc/php/7.4/fpm/pool.d/librenms.conf
vi /etc/php/7.4/fpm/pool.d/librenms.conf
CentOS 8 Debian 10
# 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@aragorn:~# cat /etc/php/7.4/fpm/pool.d/librenms.conf
; Start a new pool named ‘www’.
; the variable $pool can be used in any directive and will be replaced by the
; pool name (‘www’ here)
[librenms]
; Per pool prefix
; It only applies on the following directives:
; - ‘access.log’
; - ‘slowlog’
; - ‘listen’ (unixsocket)
; - ‘chroot’
; - ‘chdir’
; - ‘php_values’
; - ‘php_admin_values’
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user’s group
; will be used.
user = librenms
group = librenms
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; ‘ip.add.re.ss:port’ - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; ‘[ip:6:addr:ess]:port’ - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; ‘port’ - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; ‘/path/to/unix/socket’ - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php/php-fpm-librenms.sock
and:
root@aragorn:~# cat /etc/nginx/conf.d/librenms.conf
server {
listen 80;
server_name aragorn.local.lan;
root /opt/librenms/html;
index index.php;
Interesting…the ubuntu / debian instructions are different…even though ubuntu is based on Debian.
Odd stuff. I genuinely don’t know enough about that to comment on it.
Perhaps try:
vi /etc/nginx/sites-enabled/librenms.vhost
Add the following config, edit server_name as required:
also, might be worth creating a phpinfo.php file and drop that in your web directory and see if your server will serve it up. can also do the same with just a “test.htm” file just testing and see if you can browse to that. That would tell us if the web server is serving correctly, whether there’s a problem with PHP or not and whether there’s a problem with librenms.
Hi, I had the same problem and solved with this change in /etc/php/7.4/fpm/pool.d/librenms.conf file:
user = librenms
group = librenms
listen = /run/php/php-fpm-librenms.sock
;listen = /run/php/php7.4-fpm.sock
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
daily.sh output -
$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data