Use websocket with domain name

Sakthybaalan

Registered
Jul 9, 2019
4
0
1
SriLanka
cPanel Access Level
Root Administrator
Hello,

I am using the cPanel for the project. But the IP address is shared IP. I want to run the websocket(wss) with created sub domain via cPanel (i.e: www.websoc.example.com).
I found the vhost and changed for my request as follows but, If I use this via WHM include files, will it affect others running sites on that same shared IP?

Sample vhost

Code:
<VirtualHost *:443>
  # Common SSL Config
  ServerName websoc.example.com
 
  SSLEngine on
  SSLCertificateFile "/home/virtfs/usernew/etc/apache2/conf.d/ssl.crt/server.crt"
  SSLCertificateKeyFile "/home/virtfs/usernew/etc/apache2/conf.d/ssl.crt/server.key"
  DocumentRoot "/home/usernew/www/api"
  <Directory  "/home/usernew/www/api">
    Options +Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
  # Websocket proxy
  # wss redirects to working ws protocol
  ProxyPass /wss ws://139.26.xxx.xxx:9090 retry=0 keepalive=On
  ProxyPassReverse /wss ws://139.26.xxx.xxx:9090 retry=0
</VirtualHost>
 

Henry Carter

Member
Jul 31, 2019
18
0
1
India
cPanel Access Level
Website Owner
Hi,

You can change the virtual host entry for the specified IP address in which the website is associated as follows so that other IP address and sites are not affected.


<VirtualHost *SHARED IP*:443>
# Common SSL Config
ServerName websoc.example.com

</VirtualHost>
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter