yum install mod_ssl -y
Create Directory for SSL key.
mkdir /etc/ssl/key chmod 700 /etc/ssl/key
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/key/localhost.key -out /etc/ssl/certs/localhost.crt
Fill out the info or what is applicable.
Now edit the LibreNMS Apache config file /etc/httpd/conf.d/librenms.conf
All you have to do is add the following three lines under the VirtualHost and change *:80 to *:443.
SSLEngine on SSLCertificateFile /etc/ssl/certs/localhost.crt SSL CertificateKeyFile /etc/ssl/key/localhost.key
So when your finished the file should look like this.
<VirtualHost *:443> DocumentRoot /opt/librenms/html/ ServerName server_hostname_or_IP SSLEngine on SSLCertificateFile /etc/ssl/certs/localhost.crt SSLCertificateKeyFile /etc/ssl/key/localhost.key 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>
Don’t forget to allow https/port 443 traffic through the firewall. Guide here
If you have any issues, you may need to chmod the key and crt file.
chmod 644 /etc/ssl/certs/localhost.crt chmod 644 /etc/ssl/key/localhost.key
You should now be able to access LibreNMS using https. Note, you’ll need to allow an exception in your browser for your self signed certificate.