HOWTO for APACHE2 config, for Ubuntu 19?


Most matter setup with apache2 firewall is not working properly, specifically websocket port.

Setup is:

  1. Mostmatter server is behind firewall, on ubuntu 19, working fine.
  2. Firewall is using Apache2 to proxy the domain name. Unfortunately cannot use NGINX

Is there any HOWTO for APACHE2 config, for Ubuntu 19?

Thanks in advance!

Some guides can be found here:

1 Like

This is most likely due to needing to reverse proxy the WebSocket port. Included is the setup for my apache2 Mattermost install, which has a working WebSocket reverse proxy.

<IfModule mod_ssl.c>
<VirtualHost *:443>
  # If you're not using a subdomain you may need to set a ServerAlias to:
  # ServerAlias
  ServerName [domain URL here]
  ProxyPreserveHost On
  DocumentRoot /opt/mattermost
  # Set web sockets
  ProxyRequests Off
RemoteIPHeader CF-Connecting-IP
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/api/v3/users/websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://{REQUEST_URI} [P,QSA,L]
RewriteRule .*{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"

  <Location /api/v4/users/websocket>
    Require all granted
    ProxyPassReverse ws://
    ProxyPassReverseCookieDomain [domain URL here]

I suggest trying an apache2 configuration setup such as this for your mattermost install, if it doesn’t work please send your current apache2 configuration file for your install and I’ll take a look!