How to Install LibreNMS on Ubuntu 16.04

Prerequisites

  1. A fresh Alibaba cloud Ubuntu 16.04 instance.
  2. A static IP address 192.168.0.103 is configured on the instance.
  3. A Root password is setup on the server.

Launch Alibaba Cloud ECS Instance

apt-get update -y

Install LAMP Server

apt-get install apache2 mariadb-server -y
systemctl start apache2
systemctl start mysql
systemctl enable apache2
systemctl enable mysql
apt-get install software-properties-common -y
add-apt-repository ppa:ondrej/php
apt-get install libapache2-mod-php7.1 php7.1-cli php7.1-mysql php7.1-gd php7.1-snmp php-pear php7.1-curl snmp graphviz php7.1-mcrypt php7.1-json fping imagemagick whois mtr-tiny nmap python-mysqldb snmpd php-net-ipv4 php-net-ipv6 rrdtool git -y
phpenmod mcrypt
a2enmod php7.1
a2dismod mpm_event
a2enmod mpm_prefork
nano /etc/php/7.1/cli/php.ini
date.time = Asia/Kolkata

Configure MariaDB

mysql_secure_installation
Change the password for root ? N
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y
mysql -u root -p
MariaDB [(none)]> CREATE DATABASE librenmsdb;
MariaDB [(none)]> CREATE USER 'librenmsuser'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON librenmsdb.* TO 'librenmsuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit;

Download LibreNMS

useradd librenms -d /opt/librenms -M -r
usermod -a -G librenms www-data
cd /opt/
git clone https://github.com/librenms/librenms.git librenms
./scripts/composer_wrapper.php install --no-dev
chown -R librenms:librenms /opt/librenms/
chmod -R 755 /opt/librenms

Configure Apache for LibreNMS

nano /etc/apache2/sites-available/librenms.conf
<VirtualHost *:80>
DocumentRoot /opt/librenms/html/
ServerName example.com
CustomLog /opt/librenms/logs/access_log combined
ErrorLog /opt/librenms/logs/error_log
AllowEncodedSlashes NoDecode
<Directory "/opt/librenms/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
a2ensite librenms.conf
a2enmod rewrite
systemctl restart apache2

Access LibreNMS Web Installation Wizard

cd /opt/librenms
cp librenms.nonroot.cron /etc/cron.d/librenms
cp misc/librenms.logrotate /etc/logrotate.d/librenms
systemctl restart cron
logrotate -f /etc/logrotate.conf
/opt/librenms/validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.41-13-g447ae69
DB Schema | 253
PHP | 7.1.18-1+ubuntu16.04.1+deb.sury.org+1
MySQL | 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool | 1.5.5
SNMP | NET-SNMP 5.7.3
====================================
[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Related Alibaba Cloud Products

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Our Investment in Ottertune: AI automated Database optimisation platform

All you need to know about Spring and its Architecture

S3 and missing rows in Redshift

How would you solve (Palindrome Permutation)

Building in Public with Product Hunt’s Ship

Architecture and Practices of Bilibili’s Real-time Platform

Best Free Data Science Courses

Flutter with Firebase

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

How to setup 3 node cluster in Apache Kafka

Multi-Node Docker Swarm on CentOS 8 Stream, Installed on  ESXi Host

Updating a Confluence Page Automatically with Gitlab CI

How To Install Prometheus On Ubuntu 20.04 With Let’s Encrypt SSL And Authentication