I have a dedicated server with lots of sites on it and accounts and every account has domains and subdomains.
I was trying in the past few days to host Traccar on subdomain for an account, lets say the account name is user1, the account has a domain mydomain.com, I want to host Traccar on subdomain track.mydomain.com, and because Traccar needs root to be installed I installed it from root user using default installer, but I could not mange to direct my subdomain to Traccar installation at first.
Finally I learned how to create virtual host for my server and override my subdomain default virtual host using apache linked files.
so I created the following virtual host linked files:
1- std in path etc/apache2/conf.d/userdata/std/2_4/user1/track.mydomain.com/traccar.conf
ServerName track.mydomain.com
ServerAlias www.track.mydomain.com
ServerAdmin webmaster@track.mydomain.com
Redirect / https://track.mydomain.com/
2- ssl in path etc/apache2/conf.d/userdata/ssl/2_4/user1/track.mydomain.com/traccar.conf
ServerName track.mydomain.com
ServerAdmin webmaster@track.mydomain.com
DocumentRoot /opt/traccar
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 /var/cpanel/ssl/apache_tls/track.mydomain.com/combined
And after that I am able to open Traccar web interface using my subdomain and login and add devices … etc. But there are no live updates on tracking or anything I do, and in browser error log i see this error:
WebSocket connection to 'wss://track.devbey.com/api/socket' failed: Error during WebSocket handshake: Unexpected response code: 405
I asked on traccar forum they said it's not a traccar problem. What can i do to solve this issue or track the cause of it at least ? Could it be hosting provider blocking the Websocket connections ?