お疲れ様です!システム開発していてメンバーにお知らせがあるときにメールするのが面倒な時にチャットがあると良いなぁと思ったので現状でフリーのよさげなチャット Mattermost をインストールしてみました。フリーだと LDAP/AD 認証が使えないのが何ですね。。。
目次
準備
MySQL をインストール
デフォルトで使われている DB が MySQL へなのでインストールします。
既にインストール済みのときは不要です。
MySQL :: Download MySQL Installer から最新をダウンロードしてインストールします。(投稿時 5.7.22.0 )
データベースの作成
MySQL Workbench を起動してデータベースとユーザーを作成します。
インストール時に作成したデフォルトのインスタンスに接続し、Query のエディタータブで下記を実行します。
CREATE DATABASE mattermost; GRANT ALL ON mattermost.* to mattermost@localhost IDENTIFIED BY 'パスワード'; FLUSH PRIVILEGES;
WinSW のダウンロード
WinSW は任意のプログラムを Windows のサービスとして起動、停止できるソフトウェアです。
下記から最新の WinSW.NET4.exe をダウンロードします。
Mattermost を取得
Download – Mattermost で最新のバージョンを確認して下記URLの「x.y.z」に当てはめたURLでダウンロードします。(投稿時 4.10.0)
https://releases.mattermost.com/**x.y.z**/mattermost-team-**x.y.z**-windows-amd64.zip
Ver 4.x https://releases.mattermost.com/4.0.5/mattermost-team-4.0.5-windows-amd64.zip https://releases.mattermost.com/4.1.2/mattermost-team-4.1.2-windows-amd64.zip https://releases.mattermost.com/4.2.2/mattermost-team-4.2.2-windows-amd64.zip https://releases.mattermost.com/4.3.4/mattermost-team-4.3.4-windows-amd64.zip https://releases.mattermost.com/4.4.5/mattermost-team-4.4.5-windows-amd64.zip https://releases.mattermost.com/4.5.2/mattermost-team-4.5.2-windows-amd64.zip https://releases.mattermost.com/4.6.3/mattermost-team-4.6.3-windows-amd64.zip https://releases.mattermost.com/4.7.4/mattermost-team-4.7.4-windows-amd64.zip https://releases.mattermost.com/4.8.2/mattermost-team-4.8.2-windows-amd64.zip https://releases.mattermost.com/4.9.4/mattermost-team-4.9.4-windows-amd64.zip https://releases.mattermost.com/4.10.4/mattermost-team-4.10.4-windows-amd64.zip Ver 5.x https://releases.mattermost.com/5.0.3/mattermost-team-5.0.3-windows-amd64.zip https://releases.mattermost.com/5.1.2/mattermost-team-5.1.2-windows-amd64.zip https://releases.mattermost.com/5.2.2/mattermost-team-5.2.2-windows-amd64.zip https://releases.mattermost.com/5.3.1/mattermost-team-5.3.1-windows-amd64.zip https://releases.mattermost.com/5.4.0/mattermost-team-5.4.0-windows-amd64.zip https://releases.mattermost.com/5.5.2/mattermost-team-5.5.2-windows-amd64.zip https://releases.mattermost.com/5.6.3/mattermost-team-5.6.3-windows-amd64.zip https://releases.mattermost.com/5.7.3/mattermost-team-5.7.3-windows-amd64.zip https://releases.mattermost.com/5.8.2/mattermost-team-5.8.2-windows-amd64.zip https://releases.mattermost.com/5.9.8/mattermost-team-5.9.8-windows-amd64.zip https://releases.mattermost.com/5.10.2/mattermost-team-5.10.2-windows-amd64.zip https://releases.mattermost.com/5.11.1/mattermost-team-5.11.1-windows-amd64.zip https://releases.mattermost.com/5.12.6/mattermost-team-5.12.6-windows-amd64.zip https://releases.mattermost.com/5.13.3/mattermost-team-5.13.3-windows-amd64.zip https://releases.mattermost.com/5.14.5/mattermost-team-5.14.5-windows-amd64.zip https://releases.mattermost.com/5.15.5/mattermost-team-5.15.5-windows-amd64.zip https://releases.mattermost.com/5.16.5/mattermost-team-5.16.5-windows-amd64.zip https://releases.mattermost.com/5.17.3/mattermost-team-5.17.3-windows-amd64.zip https://releases.mattermost.com/5.18.2/mattermost-team-5.18.2-windows-amd64.zip https://releases.mattermost.com/5.19.1/mattermost-team-5.19.1-windows-amd64.zip https://releases.mattermost.com/5.20.2/mattermost-team-5.20.2-windows-amd64.zip https://releases.mattermost.com/5.21.0/mattermost-team-5.21.0-windows-amd64.zip https://releases.mattermost.com/5.22.3/mattermost-team-5.22.3-windows-amd64.zip https://releases.mattermost.com/5.23.2/mattermost-team-5.23.2-windows-amd64.zip https://releases.mattermost.com/5.24.3/mattermost-team-5.24.3-windows-amd64.zip https://releases.mattermost.com/5.25.4/mattermost-team-5.25.4-windows-amd64.zip https://releases.mattermost.com/5.26.2/mattermost-team-5.26.2-windows-amd64.zip https://releases.mattermost.com/5.27.2/mattermost-team-5.27.2-windows-amd64.zip https://releases.mattermost.com/5.28.2/mattermost-team-5.28.2-windows-amd64.zip https://releases.mattermost.com/5.29.2/mattermost-team-5.29.2-windows-amd64.zip https://releases.mattermost.com/5.30.3/mattermost-team-5.30.3-windows-amd64.zip https://releases.mattermost.com/5.31.9/mattermost-team-5.31.9-windows-amd64.zip https://releases.mattermost.com/5.32.1/mattermost-team-5.32.1-windows-amd64.zip https://releases.mattermost.com/5.33.5/mattermost-team-5.33.5-windows-amd64.zip https://releases.mattermost.com/5.34.5/mattermost-team-5.34.5-windows-amd64.zip https://releases.mattermost.com/5.35.5/mattermost-team-5.35.5-windows-amd64.zip https://releases.mattermost.com/5.36.2/mattermost-team-5.36.2-windows-amd64.zip https://releases.mattermost.com/5.37.2/mattermost-team-5.37.2-windows-amd64.zip https://releases.mattermost.com/5.38.2/mattermost-team-5.38.2-windows-amd64.zip https://releases.mattermost.com/5.39.0/mattermost-team-5.39.0-windows-amd64.zip https://releases.mattermost.com/5.39.3/mattermost-team-5.39.3-windows-amd64.zip https://releases.mattermost.com/6.0.4/mattermost-team-6.0.4-windows-amd64.zip https://releases.mattermost.com/6.1.1/mattermost-team-6.1.1-windows-amd64.zip https://releases.mattermost.com/6.2.1/mattermost-team-6.2.1-windows-amd64.zip
インストール
インストールはダウンロードしたファイルを展開して適当なフォルダへ配置するだけです。
ここでは C:\Dev\Mattermost とします。
設定ファイルの修正
設定ファイルの C:\Dev\Mattermost\config\config.json を修正します。
ポートの変更
ServiceSettings の下記の値を変更します。
- “ListenAddress” で指定されているポート “:8065” を “:8400” に変更します。
ポートは環境によって決定してください。
データベースの変更
SqlSettings の下記の値を変更します。
- “DataSource” で指定されている “mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s” を “mattermost:パスワード@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s” に変更します。
言語の変更
LocalizationSettings の下記の値を変更します。
- “DefaultServerLocale” で指定されている言語 “en” を “ja” に変更します。
- “DefaultClientLocale” で指定されている言語 “en” を “ja” に変更します。
サービスとして登録
ダウンロードした WinSW.NET4.exe を C:\Dev\Mattermost フォルダへ移動して Mattermost.exe に名前を変更し、設定ファイルとして下記の内容で Mattermost.xml ファイルを作成します。
ポートやパスは環境に合わせて変更してください。
<service> <id>Mattermost</id> <name>Mattermost</name> <description>Mattermost Team</description> <executable>C:\Dev\Mattermost\bin\mattermost.exe</executable> <arguments></arguments> <logmode>rotate</logmode> </service>
※ バージョン5以降からは実行ファイルが「platform.exe」から「mattermost.exe」に変更されています。
Windows キーを押下して cmd と入力後 Ctrl + Shift + Enter を押下して管理者:コマンドプロンプトを起動し C:\Dev\Mattermost へ移動します。
cd /d C:\Dev\Mattermost
下記コマンドでサービスに追加します。
Mattermost.exe install
Mattermost 初期設定
上で作成したサービスを開始します。
しばらくしたらブラウザで http://localhost:8400/ にアクセスします。
管理者アカウントの登録
メールアドレス、ユーザー名、パスワードを入力してアカウントを作成します。
チームを作成
新しいチームを作成します。
部署、プロジェクト、会社等、チームとチャンネルでどう分けたらいいか悩みますね。。。(;´・ω・)
上で指定したチーム名に対してのURLを指定します。
チームが作成されたのでユーザーを招待しましょう。
システムコンソールの設定
サイトのURLを指定します。
これ設定しないと要らんメッセージが出続けるので設定しちゃいます。
メール通知を有効にします。
メール送信しない方針でも有効にしておかないと要らんメッセージが出続けるので有効にしちゃいます。