HOWTO for APACHE2 config, for Ubuntu 19?

Hello,

Issue:
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 www.mydomain.com
  ServerName [domain URL here]
  ServerAdmin XXXXX-REMOVED-XXXXX
  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://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"

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

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!

2 Likes