Secure connection error - setting up using Google Cloud VM

Mat4 years ago

I've followed the instructions in the Documentation however if I go to my server with HTTPS it takes me to this the Apache2 Ubuntu Default Page, if I go to the server with just http: it shows the Powered by Traccer etc but nothing else loads.

This is my configuration in the traccar.conf file:

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>

                ServerName MYWEBSITENAME.co.uk
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html

                ProxyPass /api/socket ws://10.154.0.13:8082/api/socket/
                ProxyPassReverse /api/socket ws://10.154.0.13:8082/api/socket/

                ProxyPass / http://10.154.0.13:8082/
                ProxyPassReverse / http://10.154.0.13:8082/

                SSLEngine on
                SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        </VirtualHost>
</IfModule>

I'm using a google VM and have set allow HTTPS and open port 8082

Followed the instructions on https://certbot.eff.org/ for Ubuntu 18.04

Any help would be greatly appreciated

Slawek4 years ago

Your server is up ?

Mat4 years ago

Yes, I checked the logs the server is running.

On the Apache page that loads it says:
If you can read this page, it means that the Apache HTTP server installed at this site is working properly. You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.

Any ideas on what I should replace this file with?

Thanks for your help

ETA:

I've just gone through the Certbot install again and noticed this message:

Err:6 http://ppa.launchpad.net/certbot/certbot/ubuntu eoan Release
404 Not Found [IP: 91.189.95.83 80]

and

The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu eoan Release' does not have a Release file.

Slawek4 years ago

if ip your server is 10.154.0.13, is not visible for other except you, maybe firewall .

Kleent4 years ago

@Mat
Please see this post

Slawek4 years ago
Mat4 years ago

@kleent

Thanks for the link - Like you I had traccar.xml set to port 80, I've changed that to port 8082 now to match the traccar.conf file yet I still keep seeing the" Apache2 Ubuntu Default Page" - Here's a picture of what I'm seeing - https://ibb.co/W3bGTXB

@ Slawek

Thanks, I'm pretty sure I've followed the documentation correctly. That's what's got me in to this mess!

Appreciate all your help! :-)

Mat4 years ago

I've tried setting both files to port 80 (just to rule out it being something funny with the 8082 Port) but still no luck.

Should I be replacing the /var/www/html/index.html file with something?

Kleent4 years ago

Are you using ssl certificates from Lets Encrypt or self-signed ones ?
If self-signed, make sure you follow(ed) the proper way to generate them as there are some methods that will generate "unusable" certs for the server.
If you are using Let's Encrypt, you should carefully read the final messages at the end of the process. if everything has been done correctly, Certbot will modify/add the necessary information (path to the generated certs) to the vhost file (traccar.conf).

Please check your log files too.

Mat4 years ago

Thanks

I'm using Lets Encrypt and the certificate is working - if I go to my sever's web address the connection is secure it's just that it loads the index.html file and not my traccar server.

I'd rather not post my URL here but if you send me an email to [removed] I can email it to you.

Which logs are you referring to? The /var/log/apache2/error.log?

Kleent4 years ago

Did you restart both traccar and apache services after the modification, cleared browser cache... ?
Any error in logs ?

Kleent4 years ago

Yes /var/log/apache2/error.log and the traccar logs /opt/traccar/logs/tracker-server.log
Also check the /var/log/apache2/other_vhosts_access.log

Mat4 years ago

Yes I've cleared both of those. I've just put all my config into privatebin - https://privatebin.net/?24fb0ca47268fc4a#8xNRPYF1AhrynMat6UzyhAqXADyDbwTc2fMp5WQoRnkx

Kleent4 years ago

Beware of what you leave in the log files before posting...
The traccar.conf file is reffering to the default installed ssl certs (SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem ).
Meaning that the Let's encrypt process didn't work out as planned.
Also the traccar.xml file looks "strange" to me. Its content is not as that of the how-to guide.

Please review both files content.

Mat4 years ago

So i've done some playing about and my site just loads whichever file is in /var/www/html