Apache - WHM

πŸš€ Laravel Reverb + Apache (cPanel/WHM) WebSocket Proxy Setup

This guide explains how to proxy Laravel Reverb WebSocket traffic through Apache when hosting on cPanel/WHM. By default, cPanel does not allow editing Apache <VirtualHost> directly, so we use userdata includes.

1. Enable required Apache modules

Make sure the following Apache modules are enabled in WHM β†’ EasyApache 4 β†’ Apache Modules:

  • mod_proxy

  • mod_proxy_http

  • mod_proxy_wstunnel

  • mod_rewrite

  • mod_headers

Verify via CLI:

httpd -M | egrep "proxy|rewrite|headers"

2. Create vhost include files

For the domain portal.example.com (replace with your domain), same with the username example_username (replace with the cpanel account username). First create the parent folder before creating the config files,

mkdir -p /etc/apache2/conf.d/userdata/std/2_4/example_username/portal.example.com/
mkdir -p /etc/apache2/conf.d/userdata/ssl/2_4/example_username/portal.example.com/

then create two include files:

3. Add WebSocket proxy rules

Paste this into both files:

4. Apply changes

Run:

Last updated

Was this helpful?