WSS Issue VPBX 4 Fresh Install

After fresh install Vitalpbx v4 several times , and installing Vitxi ,
The error occured

The connection to your server could not be established.

Please, contact the administrator.

and after tracing the problem :

  • Port 6001 , 8089 ,3500-3501 443 is open on the firewall and reachable
  • when accessing https://FQDN:8089/ws opens and get upgrade required
  • SSL Certificate issued from letsencrypt and vaild
  • PJSIP Profile is correct and configured

But no luck the vitix don’t load
we also open the browser console . and get this message
Waterfox can’t establish a connection to the server at wss://FQDN:6001/app/vitxi4561aq/console.

When tried to run the command thats correct ssl
root@vitalpbx:~# /usr/share/vitxi/backend/artisan websockets:ssl-config
/usr/bin/env: ‘php\r’: No such file or directory

also we checked /usr/share/vitxi/backend/.env we found thats the section of the
is Empty

This is fatal issue , kindly support asap ,

Regards Mohamed Soliman

Try the below to fix the newline (from stackoverflow)

cd /usr/share/vitxi/backend
tr -d '\015' <artisan >
mv artisan artisan.old
mv artisan
chmod +x artisan
chown www-data:www-data artisan

Then run /usr/share/vitxi/backend/artisan websockets:ssl-config again.

You can also install dos2unix apt install dos2unix and run

dos2unix /usr/share/vitxi/backend/artisan