{"id":1824,"date":"2018-02-08T03:39:11","date_gmt":"2018-02-08T03:39:11","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=1824"},"modified":"2018-10-19T17:16:32","modified_gmt":"2018-10-19T17:16:32","slug":"add-self-signed-ssl-certificate-to-librenms-in-centos","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/add-self-signed-ssl-certificate-to-librenms-in-centos\/","title":{"rendered":"Add Self Signed SSL certificate to LibreNMS in CentOS"},"content":{"rendered":"<p>Install mod_ssl<\/p>\n<pre>yum install mod_ssl -y<\/pre>\n<p>Create Directory for SSL key.<\/p>\n<pre>mkdir \/etc\/ssl\/key\r\nchmod 700 \/etc\/ssl\/key<\/pre>\n<p>Create certificate.<\/p>\n<pre>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/pki\/tls\/private\/localhost.key -out \/etc\/pki\/tls\/certs\/localhost.crt<\/pre>\n<p>Fill out the info or what is applicable.<\/p>\n<p>Now edit the LibreNMS Apache config file \/etc\/httpd\/conf.d\/librenms.conf<\/p>\n<p>All you have to do is add the following three lines under the VirtualHost and change *:80 to *:443.<\/p>\n<pre>SSLEngine on\r\nSSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt\r\nSSL CertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key<\/pre>\n<p>So when your finished the file should look like this.<\/p>\n<pre>&lt;VirtualHost *:443&gt;\r\n DocumentRoot \/opt\/librenms\/html\/\r\n ServerName server_hostname_or_IP\r\n SSLEngine on\r\n SSLCertificateFile \/etc\/pki\/tls\/certs\/localhost.crt\r\n SSLCertificateKeyFile \/etc\/pki\/tls\/private\/localhost.key\r\n CustomLog \/opt\/librenms\/logs\/access_log combined\r\n ErrorLog \/opt\/librenms\/logs\/error_log\r\n AllowEncodedSlashes NoDecode\r\n &lt;Directory \"\/opt\/librenms\/html\/\"&gt;\r\n Require all granted\r\n AllowOverride All\r\n Options FollowSymLinks MultiViews\r\n &lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Don&#8217;t forget to allow https\/port 443 traffic through the firewall.\u00a0 Guide <a href=\"http:\/\/www.incredigeek.com\/home\/how-to-allow-a-port-through-firewalld\/\">here<\/a><\/p>\n<p>If you have any issues, you may need to chmod the key and crt file.<\/p>\n<pre>chmod 644 \/etc\/pki\/tls\/certs\/localhost.crt\r\nchmod 644 \/etc\/pki\/tls\/private\/localhost.key<\/pre>\n<p>You should now be able to access LibreNMS using https.\u00a0 Note, you&#8217;ll need to allow an exception in your browser for your self signed certificate.<\/p>\n<p>https:\/\/LibreNMS_IP_Address<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install mod_ssl yum install mod_ssl -y Create Directory for SSL key. mkdir \/etc\/ssl\/key chmod 700 \/etc\/ssl\/key Create certificate. openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/pki\/tls\/private\/localhost.key -out \/etc\/pki\/tls\/certs\/localhost.crt Fill out the info or what is applicable. Now edit &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/add-self-signed-ssl-certificate-to-librenms-in-centos\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,24,352,3,22],"tags":[17,358,357,353,7,389,390],"class_list":["post-1824","post","type-post","status-publish","format-standard","hentry","category-centos-linux","category-fedora-2","category-librenms","category-linux","category-redhat-linux","tag-centos","tag-cert","tag-https","tag-librenms","tag-linux-2","tag-nms","tag-openssl"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=1824"}],"version-history":[{"count":8,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1824\/revisions"}],"predecessor-version":[{"id":2153,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/1824\/revisions\/2153"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=1824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=1824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=1824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}