Skip to content

Mattermost

gabx edited this page Jul 8, 2017 · 4 revisions

Mattermost

Mattermost is a production-ready Linux self-hosted Slack alternative. It is written in Goland and React, and run with Postgres.

Installation and settings have been done following the [mattermost official doc] (https://docs.mattermost.com/install/prod-rhel-7.html) for RHEL 7.

NOTE: We Created a new A record mattermost.thetradinghall.com.

Postgresql settings

  • Create the mattermost database and user
postgres=# CREATE USER mattermost WITH PASSWORD 'XXXYYY';
CREATE ROLE
postgres=# CREATE DATABASE mattermost_db TEMPLATE template0 OWNER mattermost;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost_db to mattermost;
GRANT
postgres=# \c mattermost_db
mattermost_db=# CREATE SCHEMA mattermostSchema AUTHORIZATION mattermost;
CREATE SCHEMA
mattermost_db=# \q
  • Alter
/db/pgsql/data/pg_hba.conf
---------------------------------
local     mattermost_db         mattermost      peer   map=mattermap
---------------------
  • Alter
/db/pgsql/data/pg_ident.conf
----------------------------
mattermap      mattermost              mattermost
-----------------------------
  • check
% psql --dbname=mattermost_db --username=mattermost
psql (9.5.3)
Type "help" for help.

mattermost=>

Mattermost installation and settings

Until there is a Fedora package for Mattermost, we choose to install the build folder in /opt.

1- download the last version

2- Create a system user and group that will run the service

# useradd -r -s /bin/bash mattermost -U

3- give acces rights

# chown -R mattermost:mattermost /opt/mattermost/data

4- edit

# vim /opt/mattermost/config/config.json

5- check the connection

$ cd /opt/mattermost/bin
# ./Platforms

If everything is OK, you will see after some initialization lines:

Server is listening on :8065

Systemd service file

Create and edit:

/etc/systemd/system/mattermost.service
-------------------------------------
[Unit]
Description=Mattermost server
After=network.target postgresql.service

[Service]
WorkingDirectory=/opt/mattermost/bin
User=mattermost
Group=mattermost
ExecStart=/opt/mattermost/bin/platform
LimitNOFILE=49152
Restart=on-failure

[Install]
WantedBy=multi-user.target

Set up Nginx

We use NGINX for proxying request to the Mattermost Server

Write Fedora .spec file

Ressources

Clone this wiki locally