Install Mattermost (premise below)
Follow the steps in the official documentation below https://docs.mattermost.com/install/install-rhel-7.html
# cd
# curl -O https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6672 100 6672 0 0 5086 0 0:00:01 0:00:01 --:--:-- 5089
# yum localinstall pgdg-redhat-repo-latest.noarch.rpm
:
Has completed!
# yum install postgresql95-server postgresq95-contrib
:
Has completed!
Set environment variables to specify initdb parameters
# export PGSETUP_INITDB_OPTIONS="--locale=ja_JP.UTF8"
# /usr/pgsql-9.5/bin/postgresql95-setup initdb
# systemctl enable postgresql-9.5
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-9.5.service to /usr/lib/systemd/system/postgresql-9.5.service.
# systemctl start postgresql-9.5
# su - postgres
Create a database (locale is Japan)
$ psql
psql (9.5.24)
"help"Get help with.
postgres=# CREATE DATABASE mattermost WITH ENCODING 'UTF8' LC_COLLATE='ja_JP.UTF-8' LC_CTYPE='ja_JP.UTF-8' TEMPLATE=template0;
CREATE DATABASE
'mmuser-password' sets its own password
postgres=# CREATE USER mmuser WITH PASSWORD 'mmuser-password';
CREATE ROLE
postgres=# \q
$ exit
Check the URL of the latest installation file below https://mattermost.com/download/ This time it will be as follows https://releases.mattermost.com/5.31.0/mattermost-5.31.0-linux-amd64.tar.gz Use the curl command if the wget command is not available
# cd
# curl -O https://releases.mattermost.com/5.31.0/mattermost-5.31.0-linux-amd64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 201M 100 201M 0 0 7655k 0 0:00:26 0:00:26 --:--:-- 8125k
# tar -xvzf mattermost-5.31.0-linux-amd64.tar.gz
mattermost/
:
mattermost/logs/
Upload files and images are saved in the data directory, so change the location if necessary.
# mv mattermost /opt
# mkdir /opt/mattermost/data
#
# useradd --system --user-group mattermost
# chown -R mattermost:mattermost /opt/mattermost
# chmod -R g+w /opt/mattermost
# vi /opt/mattermost/config/config.json
/opt/mattermost/config/config.json
:
"SiteURL": "https://mattermost.example.com",
:
"DriverName": "postgres",
"DataSource": "postgres://mmuser:mmuser-pasword@localhost/mattermost?sslmode=disable\u0026connect_timeout=10",
:
# cd /opt/mattermost
# sudo -u mattermost ./bin/mattermost
{"level":"info","ts":1611110265.8058856,"caller":"app/server.go:225","msg":"Server is initializing..."}
:
{"level":"info","ts":1611110271.9833667,"caller":"app/server.go:983","msg":"Server is listening on [::]:8065","address":"[::]:8065"}
Make sure you can connect to http://mattermost.example.com:8065 Stop the server with Ctrl + C
^C{"level":"info","ts":1611110455.7103934,"caller":"app/server.go:721","msg":"Stopping Server..."}
:
{"level":"info","ts":1611110455.7169805,"caller":"app/server.go:799","msg":"Server stopped"}
# vi /etc/systemd/system/mattermost.service
/etc/systemd/system/mattermost.service
[Unit]
Description=Mattermost
After=syslog.target network.target postgresql-9.5.service
[Service]
Type=notify
WorkingDirectory=/opt/mattermost
User=mattermost
ExecStart=/opt/mattermost/bin/mattermost
PIDFile=/var/spool/mattermost/pid/master.pid
TimeoutStartSec=3600
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target
# chmod 664 /etc/systemd/system/mattermost.service
# systemctl daemon-reload
# systemctl enable mattermost
# systemctl start mattermost
Make sure you can connect to http://mattermost.example.com:8065
First, create a team and display the team Follow the steps below to change the display language Account Settings > Display > Language > Japanese > Save
System Console> Site Settings> Notifications
Enable email notifications: Enabled
Notification display name: No-Reply
Email address from which notifications are sent: [email protected]
save
It is assumed that the SMTP server is running on the Mattermost server. System Console> Environment> SMTP
SMTP server port: 25
Test the connection
save
Make other settings
Reboot for the changes to take effect
# systemctl restart mattermost
Enable SSL by installing a reverse proxy Also allow access on HTTPS default port 443 Here we assume that Nginx is already installed Also, it is assumed that include /etc/nginx/conf.d/*.conf is described in /etc/nginx/nginx.conf.
Create a configuration file
# vi /etc/nginx/conf.d/mattermost.example.com
:/etc/nginx/conf.d/mattermost.example.com
upstream backend {
server localhost:8065;
keepalive 32;
}
:
server {
listen 80 default_server;
server_name mattermost.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name mattermost.example.com;
http2_push_preload on; # Enable HTTP/2 Server Push
#ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_session_timeout 1d;
:
Enable the config file
# cd /etc/nginx/conf.d
# ln -s /etc/nginx/conf.d/mattermost.example.com mattermost.example.com.conf
# systemctl restart nginx
Recommended Posts