port issues

Thomas SERRATE2 months ago

Hello,

I'm coming to you because I don't understand how the "web.port" port works in the configuration file (traccar.xml)

currently in my :

<entry key='web.port'>47777</entry>
<entry key='osmand.port'>5055</entry>

On my android devices with Traccar Client I use http://myddns:47777 → that works properly

I then configured my traccar.conf in Apache as follows :

<IfModule mod_ssl.c>
        <VirtualHost *:47654>

                #ServerName traccar
                ServerAlias 10.10.10.20

                SSLEngine on
                SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
                
                ProxyPass /api/socket wss://localhost:47777/api/socket
                ProxyPassReverse /api/socket wss://localhost:47777/api/socket
                
                ProxyPass /api/socket ws://localhost:47777/api/socket
                ProxyPassReverse /api/socket ws://localhost:47777/api/socket
                
                ProxyPass / http://localhost:47777/
                ProxyPassReverse / http://localhost:47777/

        </VirtualHost>
</IfModule>

The problem is that I don't understand why the web.port parameter is the one used for listening to the gps and not for the web interface...

As soon as I set web.port to 47654 (the port I use to access my web interface), nothing works.

This is the first time I've taken on a GPS project, so I don't have all the keys in hand.

If anyone could enlighten me...

The goal would be :

  • HTTPS access to the web interface on port 47654
  • that the link to send the GPS coordinates is http://myddns:47777

Thank you for your understanding

Anton Tananaev2 months ago

You can't have two processes listening on the same port. That's why when you set Traccar port the same as Apache, nothing works. I don't know how you expect it to work.

Thomas SERRATE2 months ago

Hello Anton,

As a result, I have HTTP access to the interface via traccar.xml (web.port 47777) and HTTPS access to the interface via Apache's traccar.conf (<VirtualHost *:47654>).

With the reverse proxy, traffic to the websocket passes through port 47777, but my traccar.xml conf file is confusing, given what's said in the documentation:

webport.png

Do you think my current configuration is correct?

Anton Tananaev2 months ago

What is confusing about the documentation?

odhiambo2 months ago
                ProxyPass /api/socket wss://localhost:47777/api/socket
                ProxyPassReverse /api/socket wss://localhost:47777/api/socket <=== WSS
                
                ProxyPass /api/socket ws://localhost:47777/api/socket <========= WS
                ProxyPassReverse /api/socket ws://localhost:47777/api/socket

Why do you need the two lines duplicated, one with WSS and the other with WS?
Do you want to avoid specifying the port on the browser or no?

Anton Tananaev2 months ago

Oh that seems completely wrong. You can't have both HTTP and HTTPS on the same port. Didn't even notice it.