Quantcast
Channel: Mattermost Discussion Forums - Latest posts
Viewing all articles
Browse latest Browse all 25778

Mattermost Apache Configuration

$
0
0

If you do want to try it again with apache, or if someone else needs help, this is the important parts of my config. I am using a virtual hosting setup, and so I use /etc/apache2/sites-available/domain.conf and /etc/apache2/sites-available/sub.domain.conf, but if you are hosting one domain then /etc/apache2/apache2.conf will also work. Also, because of the vhost setup, all my domains are in the /home/domain folder instead of /var/www/ so you will have to modify my stuff as needed.... Note, the suexecusergroup is the cooldomain uid:guid as that is the owner of /home/cooldomain, so make sure yours matches with the owner of your directory structure (possibly www-data) or leave it out entirely if you are using the default apache configs and location. You will see that this essentially repeats what was mentioned in an earlier post, hopefully it helps. My server is also sitting behind a firewall with access to only 80 and 443.

Most importantly, config.json has nothing to do with this other than setting port 8065, so no other changes are necessary there - everything else is for mattermost, not apache..

<VirtualHost *:80>
SuexecUserGroup "#1040" "#1013"
ServerName my.cooldomain.com
ServerAlias www.my.cooldomain.com
RewriteEngine on
# Enforce HTTPS:
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://my.cooldomain.com/$1 [R,L]
</VirtualHost>
<VirtualHost 192.168.2.198:443>
SuexecUserGroup "#1040" "#1013"
ServerName my.cooldomain.com
ServerAlias www.my.cooldomain.com
DocumentRoot /home/cooldomain/domains/my.cooldomain.com/public_html
ErrorLog /var/log/virtualmin/my.cooldomain.com_error_log
CustomLog /var/log/virtualmin/my.cooldomain.com_access_log combined
ScriptAlias /cgi-bin/ /home/cooldomain/domains/my.cooldomain.com/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/cooldomain/domains/my.cooldomain.com/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/cooldomain/domains/my.cooldomain.com/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/cooldomain/domains/my.cooldomain.com/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/cooldomain/domains/my.cooldomain.com/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
# **Begin Mattermost specific code**
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"

RequestHeader unset If-Modified-Since
RequestHeader unset If-None-Match

<Location /api/v1/websocket>
Require all granted
ProxyPassReverse ws://127.0.0.1:8065/api/v1/websocket
ProxyPassReverseCookieDomain 127.0.0.1 my.cooldomain.com
</Location>
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 my.cooldomain.com
</Location>

ProxyPreserveHost On
ProxyRequests Off
# **End Mattermost specific code**

RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
SSLEngine on
SSLCertificateFile /home/cooldomain/domains/my.cooldomain.com/ssl.cert
SSLCertificateKeyFile /home/cooldomain/domains/my.cooldomain.com/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCACertificateFile /home/cooldomain/domains/my.cooldomain.com/ssl.ca
</VirtualHost>

Viewing all articles
Browse latest Browse all 25778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>