Document Apache Proxy

Description

Would highly appreciate community's help testing and documenting Apache setup with Mattermost in https://github.com/mattermost/docs/tree/master/source/install

Requested many times:
https://gitlab.com/gitlab-org/gitlab-mattermost/issues/42
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/746

Below is a start:


@stephenfin Here's the main part. There is also a bit that catches HTTP and redirects to HTTPS, but this does all the heavy lifting. Note I'm serving up static resources directly from Apache.

<VirtualHost *:443>
ServerName mattermost.alerque.com

DocumentRoot /usr/share/webapps/mattermost/web

SSLEngine on
SSLCertificateFile /etc/httpd/ssl.crt/alerque.com.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/alerque.com.key

ProxyPreserveHost On

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/api/v1/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/v1/websocket>
Require all granted
ProxyPassReverse ws://127.0.0.1:8065/api/vi/websocket
ProxyPassReverseCookieDomain 127.0.0.1 mattermost.alerque.com
</Location>

<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 mattermost.alerque.com
</Location>

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/httpd/mattermost.alerque.com_error.log
CustomLog /var/log/httpd/mattermost.alerque.com_forwarded.log common_forwarded
CustomLog /var/log/httpd/mattermost.alerque.com_access.log combined env=!dontlog
CustomLog /var/log/httpd/mattermost.alerque.com.log combined
</VirtualHost>

QA Test Steps

None

Mana

2

Assignee

Unassigned

QA Assignee

None

Reporter

Corey Hulen

Epic Link

None

Fix versions

None

Mattermost Team

None

Sprint

None

QA Testing Areas

None

GitHub Issue

None

Components

None
Configure