I am trying to follow tutorial located here for messaging system using RatChet PHP https://www.twilio.com/blog/create-php-websocket-server-build-real-time-even-driven-application I have my domain called example.com which have normal html page and need to serve it as normal website. for messaging system, I want port called 8445
so I have installed apache2 on ubuntu 22.04 installed lets encrypt ssl site is working fine
Now I want setup websocket server so opened tcp port 8445 in firewall
enabled apache modules
a2enmod proxy a2enmod proxy_http a2enmod proxy_wstunnel
I have replaced my original domain with example.com
my conf file is like example.com.conf
<VirtualHost *:80> ServerAdmin [email protected] ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/public_html/logs/error.log CustomLog /var/www/example.com/public_html/logs/access.log combined ProxyRequests Off ProxyPass / https://example.com:8445/ ProxyPassReverse / https://example.com:8445/ </VirtualHost> and
example.com-le-ssl.conf
<IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine On SSLProxyEngine On ServerAdmin [email protected] ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/public_html/logs/error.log CustomLog /var/www/example.com/public_html/logs/access.log combined ProxyRequests Off ProxyPass / wss://example.com:8445/ ProxyPassReverse / https://example.com:8445/ Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem <Location /> ProxyPassReverse / Options FollowSymLinks Require all granted </Location> </VirtualHost> </IfModule> When I try to connect, I am getting 503 error and apache log is saying like
[proxy_http:error] [pid 20090] [client 49.34.X.X:55961] AH01114: HTTP: failed to make connection to backend: example.com [Sat Dec 03 16:47:04.378489 2022] [proxy:error] [pid 20091] (111)Connection refused: AH00957: wss: attempt to connect to 45.33.X.X:8445 (example.com) failed
Let me know if anyone here can help me for solve issue.
Thanks!