Traccar with SSL

smsoousa 7 years ago

Hi, Anton.
I followed the documentation: https://www.traccar.org/secure-connection/
but without effect, the system does not load on port 443, still loading the Apache files, should I do some targeting? From what I saw in other topics, whoever accompanied the documentation worked perfectly, but for me it is not working, when access:

https://mysystem.com

I see the Apache index file.

I can only access the system with http://mysystem.com:8082

can you help me? Thank you

Jake Stephens 7 years ago

I've just setup my third Traccar server (Ubuntu 18.04) all with SSL following the /secure-connection guide with no issues at all.

I suggest you have a look at the Apache config file and carefully follow the secure-connection guide.

smsoousa 7 years ago

I did exactly as it is in the document, installed and activated the modules, configured the /etc/apache2/sites-available/traccar.conf included the contents of VirtualHost, activated the site and restarted apache, installed and activated the certificate. Everything is identical to the document. When I access port 443, the certificate is there, but the page that is loaded remains the apache index.

Anton Tananaev 7 years ago

I would recommend to ask on Apache resources. You issue is clearly with Apache configuration and not Traccar.

smsoousa 7 years ago

Is it some redirection to be made? Could you tell me how to configure Apache to accomplish this?

Anton Tananaev 7 years ago

You need proxy, which is what documentation describes.

smsoousa 7 years ago

So.. I followed the documentation in full, but it still seems that the configuration does not obey and instead of showing the Traccar, continues to show the Apache. I have tried and researched a lot on the forum, but nothing has managed to help me yet. All I have to do is appeal.

Turbovix 7 years ago

Friend, check my configuration in ( /etc/apache2/sites-enabled ), this will help you!

Note that my configuration is based on the Apache server!

<IfModule mod_ssl.c>

           <VirtualHost _default_:80>
               ServerName myserver.com.br
               ServerAlias www.myserver.com.br
               Redirect / https://myserver.com.br
         </VirtualHost>

         <VirtualHost _default_:443>
                ServerName myserver.com.br
                ServerAdmin myemail@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.myserver.com.br
                SSLCertificateFile /etc/letsencrypt/live/myserver.com.br/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/myserver.com.br/privkey.pem
        </VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
smsoousa 7 years ago

Hello Turbovix, thanks for the help, I did as instructed, but without effect. I keep seeing the Apache index. Any other ideas?

Turbovix 7 years ago

Is it possible to access your server?

Jake Stephens 7 years ago

Perhaps you could post your /etc/apache2/sites-enabled/traccar.conf file to give us/others something to go on.... We aren't all mind readers :-)

smsoousa 7 years ago

Turbovix, yes!
Jake Stephens, Following configuration of my: /etc/apache2/sites-enabled/traccar.conf

<IfModule mod_ssl.c>
<VirtualHost _default_:80>
               ServerName sistema.tecsat.net.br
               ServerAlias www.sistema.tecsat.net.br
               Redirect / https://sistema.tecsat.net.br
</VirtualHost>

<VirtualHost _default_:443>
                ServerName sistema.tecsat.net.br
                ServerAdmin contato@tecsat.net.br
                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.sistema.tecsat.net.br
                SSLCertificateFile /etc/letsencrypt/live/sistema.tecsat.net.br/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/sistema.tecsat.net.br/privkey.pem
</VirtualHost>
</IfModule>
Turbovix 7 years ago

smsoousa,

certamente você deixou passar alguma outra configuração, se você tiver interesse posso verificar, porém preciso acessar o servidor via ssh!

Turbovix 7 years ago

Por acaso você informou o Apache para trabalhar com o traccar.conf utilizando o comando abaixo ?

sudo a2ensite traccar.conf

Lembre-se de reiniciar o servidor apache depois!

smsoousa 7 years ago

Turbovix, send me an email so I can pass you the access.
[removed]