Traccar with SSL

smsoousa6 years ago

Yes, I installed and activated all possible modules.

Jake Stephens6 years ago

Hi Smsoousa,

Delete the VirtualHost default:80 part you have added to traccar.conf.

In /etc/apache2/sites-available/000-default.conf delete everything (or comment out) and enter the below config. That will work, providing you have setup the traccar.conf correctly. I just tested it on my dev server.

<VirtualHost *:80>
    ServerName sistema.tecsat.net.br
    Redirect / https://sistema.tecsat.net.br/
</VirtualHost>

Fingers crossed!

Jake Stephens6 years ago

Oh and remember to service apache2 restart after editing it.

Turbovix6 years ago

Jake Stephens,

This part has nothing to do with the problem, this part is important for directing the requests coming from port 80 from the http: // XXX or http: // www requests to the https protocol!

Turbovix6 years ago

See one of my servers, anyway you try to access it it will point to port 443

https://www.turbotracker.com.br
https://turbotracker.com.br
http://turbotracker.com.br
http://www.turbotracker.com.br

oM6 years ago

Hi Turbovix, Jake and smsoousa

I have the same problem that when trying to enter traccar through port 443 (https) the index of apache is displayed in ubuntu.

Please, if you are kind enough to tell me what was the solution you applied?

I look forward to your prompt response and help

Regards,
oM

Turbovix6 years ago

1 - Hi, have you checked the official documentation?

https://www.traccar.org/secure-connection/

2 - If you followed the setup correctly, you can check your settings and post here. Another thing, if your server is on AWS Amazon, you should check if the traffic on port 443 is enabled.

smsoousa6 years ago

Hello Sirs, I tried all the procedures described here, but to no avail, I gave up momentarily trying to set up, follow several steps on the internet to try some success, but to no avail.

Turbovix6 years ago

Friend, I remember having requested access to your server to make this setting, however this has not progressed. Well, for a symbolic value I can support you, or you can hire the services of the Traccar team to configure your server correctly.

oM6 years ago

Hi Sirs,

I managed to solve the inconvenience of accessing Traccar through port 443 and that it no longer shows the Apache root.
What I did was uninstall the Apache completely and start from the beginning as indicated by the Traccar on Security guide, what I did was restart the Apache service after each instruction that I was asking for:

sudo apt-get install apache2

  • sudo service apache2 restart

sudo a2enmod ssl

  • sudo service apache2 restart

sudo a2enmod proxy_http

  • sudo service apache2 restart

sudo a2enmod proxy_wstunnel
-sudo service apache2 restart

I do not know if it was a coincidence but that worked for me

Regards,
oM

globocopia6 years ago

I have the same problem, just the Apache page, I've set the ports and nothing, any tips? Thank you

Claudio Carrasco4 years ago

Hi, I do this procedure but I have the error in browser "ERR_TOO_MANY_REDIRECTS"

my traccar.conf file:


<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 ***@gmail.com
                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
                Include /etc/letsencrypt/options-ssl-apache.conf
                ServerAlias www.login.cloudgps.site
                SSLCertificateFile /etc/letsencrypt/live/login.cloudgps.site/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/login.cloudgps.site/privkey.pem

        </VirtualHost>
</IfModule>
<IfModule mod_ssl.c>

I really appreciate some help, regards!

Turbovix4 years ago

Claudio, have you checked the Traccar documentation? if you follow the guidelines described there, the server will be able to work with the SSL protocol. I prefer to work with Nginx!

https://www.traccar.org/secure-connection/

Claudio Carrasco4 years ago

Yes Turbovix, I follow the guidelines step by step and I got the error "ERR_TOO_MANY_REDIRECT" in the web browser. In fact, I set my "traccar.conf" file according to your configuration, but there is some detail that is escaping me and I don't know what it is. :(

I really appreciate your help, regards!

Turbovix4 years ago

Did you enable the module below?

# sudo a2enmod rewrite

Try this block configuration in question:

<VirtualHost _default_:80>
               ServerName login.cloudgps.site
               Redirect / https://login.cloudgps.site
 </VirtualHost>