SSL implementation problem

Claudio Carrasco4 years ago

Hi everyone!

Initially I have no problem starting the server from port 8082. My server's IP is 34.67.206.47.

I did the following:

sudo apt-get install apache2
sudo a2enmod ssl
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel
sudo service apache2 restart

Then I created the traccar.conf file:

<IfModule mod_ssl.c>
        <VirtualHost _default_:80>
               ServerName 34.67.206.47
               ServerAlias www.34.67.206.47
               Redirect / https://34.67.206.47
        </VirtualHost>
        <VirtualHost _default_:443>
                ServerName 34.67.206.47
                ServerAdmin webmaster@localhost
                DocumentRoot /var/www/html
                ProxyPass /api/socket ws://localhost:8082/api/socket
                ProxyPassReverse /api/socket ws://localhost:8082/api/socket
                ProxyPass / http://localhost:8082/
                ProxyPassReverse / http://localhost:8082/
                SSLEngine on
                SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        </VirtualHost>
</IfModule>

finally I enabled the server and restarted apache:

sudo a2ensite traccar
sudo service apache2 restart

Now, when I try to enter to 34.67.206.47:443 I can't acces, the platform loads indefinitely.

Where is the problem?

Thanks a lot!!

Anton Tananaev4 years ago
  1. Why not use a domain and a valid certificate?
  2. What exact URL are you opening?
  3. Check relevant information in the browser console.
Claudio Carrasco4 years ago

Hi Anton, thanks.

I update the settings:

<IfModule mod_ssl.c>
        <VirtualHost _default_:80>
               ServerName login.cloudgps.site
               ServerAlias www.login.cloudgps.site
               Redirect / https://login.cloudgps.site/
        </VirtualHost>
        <VirtualHost _default_:443>
                ServerName login.cloudgps.site
                ServerAdmin webmaster@localhost
                DocumentRoot /var/www/html
                ProxyPass /api/socket ws://localhost:8082/api/socket
                ProxyPassReverse /api/socket ws://localhost:8082/api/socket
                ProxyPass / http://localhost:8082/
                ProxyPassReverse / http://localhost:8082/
                SSLEngine on
                SSLCertificateFile /etc/letsencrypt/live/login.cloudgps.site/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/login.cloudgps.site/privkey.pem
        </VirtualHost>
</IfModule>

I'm trying to access via login.cloudgps.site, now I get the error ERR_CONNECTION_REFUSED

Thanks for your help

Claudio Carrasco4 years ago

Now I get the error in the browser "ERR_TOO_MANY_REDIRECTS"

Anton Tananaev4 years ago

You have infinite redirects. I would recommend you take your time and study Apache documentation.

Claudio Carrasco4 years ago

Yes, I know, but according to me the settings are correct and I can't find where the loop originates.

I would greatly appreciate a help from someone with more experience, I know that it is a detail that is escaping me.

Julio Alvarez3 years ago

I have https in a custom subdomain, use nginx and let's encrypt, ubuntu 20.04