GNU/Linux >> Linux の 問題 >  >> Cent OS

CentOS 8にMattermostをインストールする-ステップバイステップガイド?

Mattermostは、オープンソースのプライベートクラウドSlackの代替手段です。 MITライセンスの下でリリースされた、Web、PC、および電話用の職場メッセージングシステム。独自のSaaSメッセージングの代替として、Mattermostは、チームのすべてのコミュニケーションを1つの場所にまとめ、どこからでも検索およびアクセスできるようにします。最も重要なのは「Slackと互換性があり、Slackに制限されていない」ことで、既存のSlack統合との互換性を含め、Slackの着信および発信Webhook統合のスーパーセットをサポートします。既存のSlackチームから、ユーザー、公開チャンネルの履歴、さらにはテーマ設定の色をMattermostにインポートできます。

ここLinuxAPTでは、サーバー管理サービスの一環として、お客様が関連するLinuxシステムのソフトウェアインストールクエリを実行するのを定期的に支援しています。

これに関連して、CentOS8にMattermostをインストールする方法を検討します。


CentOS 8にMattermostをインストールして設定する手順は?

1.システムアップデートを実行します

まず、システムが最新であることを確認することから始めましょう:

$ sudo dnf clean all
$ sudo dnf install epel-release
$ sudo dnf update


2.データベースサーバーをインストールします

次のコマンドを実行してMariaDBをインストールします:

$ sudo dnf install mariadb-server

デフォルトでは、MariaDBは強化されていません。 mysql_secure_installationスクリプトを使用してMariaDBを保護できます。ルートパスワードを設定し、匿名ユーザーを削除し、リモートルートログインを禁止し、テストデータベースと安全なMariaDBへのアクセスを削除する各手順を注意深く読んでください。

$ mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
Remove anonymous users? [Y/n] y
 ... Success!
Disallow root login remotely? [Y/n] y
 ... Success!
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
Thanks for using MariaDB!

次に、MariaDBデータベースサーバーを再起動し、次を使用してシステムの起動時にサーバーを起動できるようにします。

$ sudo systemctl restart mariadb
$ sudo systemctl status mariadb
$ sudo systemctl enable mariadb

データベースのインストール後、MariaDBシェルにログインし、Mattermostのデータベースとユーザーを作成します。

$ mysql -u root -p
CREATE DATABASE mattermost;
GRANT ALL PRIVILEGES ON mattermost.* TO mattermost@localhost IDENTIFIED BY 'Your-Strong-Passwd';
FLUSH PRIVILEGES;
QUIT;


3.システムにMattermostをインストールします

まず、Mattermostを実行するために別のユーザーを作成する必要があります。次のコマンドで作成できます:

$ sudo useradd -d /opt/mattermost -U -M mattermost

次に、Mattermostの最新バージョンをダウンロードします:

$ wget https://releases.mattermost.com/5.20.2/mattermost-5.20.2-linux-amd64.tar.gz

Mattermostアーカイブをサーバーのドキュメントルートディレクトリに解凍します:

$ tar xf *.gz
$ mv mattermost /opt/

ファイルのストレージディレクトリを作成します:

$ mkdir /opt/mattermost/data

また、所有権と権限を設定します:

$ sudo chown -R mattermost:mattermost /opt/mattermost
$ sudo chmod -R g+w /opt/mattermost

次に、ファイル/opt/mattermost/config/config.jsonの内容にいくつかの変更を加えて、データベースドライバーを設定する必要があります。 「DriverName」と「DataSource」の行を検索し、次のように変更します。

$ nano /opt/mattermost/config/config.json
"SqlSettings": {
        "DriverName": "mysql",
        "DataSource": "mattermost:Str0ngP@ss@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
        "DataSourceReplicas": [],
        "DataSourceSearchReplicas": [],
        "MaxIdleConns": 20,
        "ConnMaxLifetimeMilliseconds": 3600000,
        "MaxOpenConns": 300,
        "Trace": false,
        "AtRestEncryptKey": "myyti1r597i99qrk7eu91ywqhaawz4md",
        "QueryTimeout": 30
    },

ファイルを保存して閉じます。次に、ディレクトリを/ opt / mattermostに変更し、次のコマンドでMattermostサーバーを起動します。

$ cd /opt/mattermost
$ sudo -u mattermost ./bin/mattermost


4.MattermostSystemdサービスを構成する

まず、次のコマンドを使用して、新しいsystemdユニットファイルを作成します。

$ nano /etc/systemd/system/mattermost.service
[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

次に、Mattermostサービスを開始し、次のコマンドを使用してシステムの再起動後に開始できるようにします。

$ sudo systemctl daemon-reload
$ sudo systemctl start mattermost.service
$ sudo systemctl enable mattermost.service

Mattermostが実行され、ポート8065でリッスンしていることを確認します。次のコマンドで確認できます:

$ curl http://localhost:8065


5.NginxをMattermostで構成する

パフォーマンスとセキュリティを向上させるために、Nginxをリバースプロキシとしてインストールして構成します。次に、CentOSシステムにNginxをインストールします:

$ sudo dnf install nginx

Nginx Webサーバーをインストールした後、次のコマンドを使用してNginxサービスを開始し、システムの再起動後に開始できるようにします。

$ sudo systemctl start nginx
$ sudo systemctl enable nginx

次に、NginxWebサーバーをMattermostのプロキシとして構成します。

$ sudo nano /etc/nginx/conf.d/mattermost.conf
upstream backend {
   server 127.0.0.1:8065;
   keepalive 32;
}
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
server {
   listen 80;
   server_name    mattermost.example.com;
   location ~ /api/v[0-9]+/(users/)?websocket$ {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 90;
       proxy_send_timeout 300;
       proxy_read_timeout 90s;
       proxy_pass http://backend;
   }
   location / {
       client_max_body_size 50M;
       proxy_set_header Connection "";
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache mattermost_cache;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }
}

最後に、Nginxサービスを再起動して、変更を適用します。

$ nginx -t
$ sudo systemctl restart nginx


6.ファイアウォールを構成する

HTTPおよびHTTPSポートでファイアウォールアクセスを許可する:

$ sudo firewall-cmd --add-service={http,https} --permanent
$ sudo firewall-cmd --reload


Mattermost Webインターフェイスにアクセスする方法?

Mattermostは、デフォルトでHTTPポート80で使用できます。

お気に入りのブラウザを開いてhttp://mattermost.example.comに移動し、メールアドレスを入力してアカウントを作成してMattermostの設定を続けます。



Cent OS
  1. Ubuntu 20.04にqtをインストールします-ステップバイステップガイド?

  2. CentOS 8にGrafanaをインストールする-ステップバイステップガイド?

  3. CentOS 8にFreeIPAをインストールする-ステップバイステップガイド?

  1. CentOS 8にOrangeScrumをインストールします-ステップバイステップガイド?

  2. Centos8にRar/Unrarをインストールする-ステップバイステップガイド?

  3. CentOS 8にClamAVをインストールします-ステップバイステップガイド?

  1. CentOS8にApacheAntをインストールします-ステップバイステップガイド?

  2. CentOS 8にNethogsをインストールする-ステップバイステップガイド?

  3. CentOS8にFoxitReaderをインストールする-ステップバイステップガイド?