Installation Mattermost system Centos 8
spób following guide describes the installation of the software in the system CentOS Mattermost 8.
Made by spending a few terminal commands.
First, we install the MySQL server command:
1 | dnf install mariadb-server -y |
Run it on your system:
1 2 | systemctl start mariadb systemctl enable mariadb |
Go to the MySQL server configuration and give the root password by typing:
1 | mysql_secure_installation |
We answer the questions as follows:
1 2 3 4 5 6 7 8 | Enter current password for root (enter for none): Set root password? [Y/n] Y New password: Re-enter new password: Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y |
During this process we give the root password.
The next step is to create the database and user. Log in to the mysql command:
1 | mysql -u root -p |
We serve previously provided by us root password and create a database:
1 | CREATE DATABASE mattermostdb; |
Then we create a user and assign him permission:
1 | GRANT ALL PRIVILEGES ON mattermostdb.* TO mattermost@localhost IDENTIFIED BY 'naszehasło'; |
naszehasło any course we replace your password.
Reload powers and leave with mysql
1 2 | FLUSH PRIVILEGES; EXIT; |
Installation Mattermost
At the beginning, add a system user:
1 | useradd -d /opt/mattermost -U -M mattermost |
Mattermosta charge command:
1 | wget https://releases.mattermost.com/5.21.0/mattermost-5.21.0-linux-amd64.tar.gz |
unpack:
1 | tar -xvzf mattermost-5.21.0-linux-amd64.tar.gz |
Mattermosta move the files to the / opt directory
1 | mv mattermost /opt/ |
We give the appropriate permissions:
1 2 3 | mkdir /opt/mattermost/data chown -R mattermost:mattermost /opt/mattermost chmod -R g+w /opt/mattermost |
Configuration Mattermost
Mattermosta edit the configuration file to connect it to the previously created database
1 | nano /opt/mattermost/config/config.json |
we find section “SqlSettings”: { and configure as follows:
1 2 3 | "SqlSettings": { "DriverName": "mysql", "DataSource": "mattermost:naszehasło@tcp(localhost:3306)/mattermostdb?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s", |
Can we go to the directory of the script and pre-launch it:
1 2 | cd /opt/mattermost sudo -u mattermost bin/mattermost |
We should like to see the log, everything is OK.
1 2 3 4 5 6 | {"level":"info","ts":1585379681.8383002,"caller":"utils/i18n.go:83","msg":"Loaded system translations","for locale":"en","from locale":"/opt/mattermost/i18n/en.json"} {"level":"info","ts":1585379681.83874,"caller":"app/server_app_adapters.go:58","msg":"Server is initializing..."} {"level":"info","ts":1585379681.8470004,"caller":"sqlstore/supplier.go:221","msg":"Pinging SQL","database":"master"} {"level":"info","ts":1585379684.7858346,"caller":"sqlstore/upgrade.go:112","msg":"The database schema version has been set","version":"5.21.0"} {"level":"error","ts":1585379690.8182986,"caller":"app/server_app_adapters.go:129","msg":"SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: http://about.mattermost.com/default-site-url"} {"level":"info","ts":1585379690.821083,"caller":"app/license.go:39","msg":"License key from https://mattermost.com required to unlock enterprise features."} |
Mattermosta stop holding down CRTL + C
The next step is to create a system service that we can manage it simply and to run in a background.
Create a file /etc/systemd/system/mattermost.service
1 | nano /etc/systemd/system/mattermost.service |
A given content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [Unit] Description=Mattermost After=syslog.target network.target mariadb.service [Service] Type=notify WorkingDirectory=/opt/mattermost User=mattermost ExecStart=/opt/mattermost/bin/mattermost PIDFile=/var/run/mattermost.pid TimeoutStartSec=3600 LimitNOFILE=49152 [Install] WantedBy=multi-user.target |
reload demon:
1 | systemctl daemon-reload |
We launch:
1 2 | systemctl start mattermost systemctl enable mattermost |
Status of services we can see by typing:
1 | systemctl status mattermost |
Below is a sample log:
1 2 3 4 5 6 7 8 9 10 11 12 | mattermost.service - Mattermost Loaded: loaded (/etc/systemd/system/mattermost.service; disabled; vendor preset: disabled) Active: active (running) since Sat 2020-03-28 03:17:07 EDT; 14s ago Main PID: 15204 (mattermost) Tasks: 21 (limit: 25028) Memory: 120.8M CGroup: /system.slice/mattermost.service ??15204 /opt/mattermost/bin/mattermost ??15214 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64 Mar 28 03:17:07 centos8 mattermost[15204]: {"level":"info","ts":1585379827.1131086,"caller":"app/server.go:247","msg":"Printing current workin> Mar 28 03:17:07 centos8 mattermost[15204]: {"level":"info","ts":1585379827.1131282,"caller":"app/server.go:248","msg":"Loaded config","source"> |
Whole should work properly, Mattermost should correspond spending browser naszadresip:8065
After going to the address we should make an initial service configuration.