Trouble setting up https for Apache2 in Ubuntu Server 16.04 for use with LibreNMS - (https works but I get the Apache2 Default Page)

I followed this guide and instead of editing /etc/apache2/sites-available/000-default.conf, I edited /etc/apache2/sites-available/librenms.conf

https actually does work, but now that it’s set up, when I go to the LibreNMS web front-end, I am now presented with the Apache2 Ubuntu Default Page instead of seeing the LibreNMS login page.

I went through the guide a few times to make sure I didn’t miss anything and I can’t figure out what I’ve done wrong. I made sure to specify the FQDN of the server everywhere I could (in the cert and in all the config files).

EDIT: I think the problem is that I ran “sudo a2ensite default-ssl” but it should probably be the file that relates to librenms… however, I don’t know exactly if this is correct. “sudo a2ensite librenms.conf” just tells me that it’s already been enabled.

And I made these changes to default-ssl.conf: DocumentRoot /opt/librenms/html (was previously /var/www/html)

disable the default-ssl cert you enabled and restart apache.

I ran sudo a2dissite default-ssl and restarted apache but that did not seem to help.

I was just thinking… do I need to add the contents of default-ssl.conf (listed on the ssl walk through) to the librenms.conf?

Here is my librenms.conf:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin [EMAIL ADDRESS]
ServerName librenms.[DOMAIN].com

DocumentRoot /opt/librenms/html/
ServerName  librenms.[DOMAIN].com
Redirect "/" "https://librenms.[DOMAIN].com/"

AllowEncodedSlashes NoDecode

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLEngine on

SSLCertificateFile      /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/opt/librenms/html/">
SSLOptions +StdEnvVars
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews

</Directory>

BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

</VirtualHost>
</IfModule>

That looks fine to me.

You can see what other vhosts are loaded with httpd -S

Have you enabled PHP within Apache?

sudo a2enmod php{version}
sudo service apache2 restart

Why would I need to enable PHP for HTTPS? The website works fine as is. I’m just having trouble with getting things to run through HTTPS. I think it’s due in part to the fact that I followed a HTTPS guide that was going by the default site, and LibreNMS uses it’s own set of files. So I need to properly translate the walk-through to apply to the LibreNMS files… that is where I am running into issues…