How to Install LibreNMS on Debian
https://docs.librenms.org/Installation/Installation-Ubuntu-1804-Apache/
Packages
apt-get install acl apache2 borgbackup curl fping hping3 htop ipcalc jq lftp lynx mlocate mtr nmap pwgen rsync sipcalc tmate tree tshark unzip vim vnstat wget zip curl apache2 composer fping git graphviz imagemagick python-memcache python-mysqldb rrdtool snmp snmpd whois mariadb-client mariadb-server mtr-tiny nmap libapache2-mod-php7.3
apt-get install php7.3-cli php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-snmp php7.3-xml php7.3-zip
add User
useradd librenms -d /opt/librenms -M -r
usermod -a -G librenms www-data
get Git
cd /opt
git clone https://github.com/librenms/librenms.git
set Permission
chown -R librenms:librenms /opt/librenms
chmod 770 /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
add Dependencis
su - librenms
./scripts/composer_wrapper.php install --no-dev
exit
systemctl restart mysql
mysql -uroot -p
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;
exit
MySQL Conf
vi /etc/mysql/mariadb.conf.d/50-server.cnf
Within the [mysqld] section please add:
innodb_file_per_table=1
lower_case_table_names=0
systemctl restart mysql
PHP Ini
vi /etc/php/7.3/apache2/php.ini
[Date]
date.timezone = Europe/Zurich
vi /etc/php/7.3/cli/php.ini
[Date]
date.timezone = Europe/Zurich
Update Apache
a2enmod php7.3
a2dismod mpm_event
a2enmod mpm_prefork
cat << EOF > /etc/apache2/sites-available/librenms.conf
<VirtualHost *:80>
DocumentRoot /opt/librenms/html/
ServerName host211.planet
AllowEncodedSlashes NoDecode
<Directory "/opt/librenms/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
EOF
Enable Site librenms.conf
a2ensite librenms.conf
a2enmod rewrite
systemctl restart apache2
SNMP
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
vi /etc/snmp/snmpd.conf
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
chmod +x /usr/bin/distro
systemctl restart snmpd
Crontab
cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms
Logrotate
cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
http://host211.planet/install.php
Fix Permission
chown librenms:librenms /opt/librenms/config.php
Any Comments ?
sha256: 9f39db52f8279c0fbb2f3072bc1da003c2334bb210d5aef9a3878e7ff55fbd13