Skip to content

Commit 705e262

Browse files
committed
new file
1 parent a8ac945 commit 705e262

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
.. _install-rhel-71-mattermost:
2+
3+
Installing Mattermost Server
4+
============================
5+
6+
Install Mattermost Server on a 64-bit machine.
7+
8+
Assume that the IP address of this server is 10.10.10.2
9+
10+
**To install Mattermost Server on RHEL 7.1**
11+
12+
1. Log into the server that will host Mattermost Server and open a terminal window.
13+
14+
2. Download `the latest version of the Mattermost Server <https://docs.mattermost.com/administration/upgrade.html#version-archive>`_. In the following command, replace ``X.X.X`` with the version that you want to download:
15+
16+
``wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz``
17+
18+
5. Extract the Mattermost Server files.
19+
20+
``tar -xvzf *.gz``
21+
22+
3. Move the extracted file to the ``/opt`` directory.
23+
24+
``sudo mv mattermost /opt``
25+
26+
4. Create the storage directory for files.
27+
28+
``sudo mkdir /opt/mattermost/data``
29+
30+
.. note::
31+
The storage directory will contain all the files and images that your users post to Mattermost, so you need to make sure that the drive is large enough to hold the anticipated number of uploaded files and images.
32+
33+
5. Set up a system user and group called ``mattermost`` that will run this service, and set the ownership and permissions.
34+
35+
a. ``sudo useradd --system --user-group mattermost``
36+
b. ``sudo chown -R mattermost:mattermost /opt/mattermost``
37+
c. ``sudo chmod -R g+w /opt/mattermost``
38+
39+
6. Set up the database driver in the file ``/opt/mattermost/config/config.json``. Open the file in your favorite text editor and make the following changes:
40+
41+
- If you are using PostgreSQL:
42+
1. Set ``"DriverName"`` to ``"postgres"``
43+
2. Set ``"DataSource"`` to the following value, replacing ``<mmuser-password>`` and ``<host-name-or-IP>`` with the appropriate values:
44+
``"postgres://mmuser:<mmuser-password>@<host-name-or-IP>:5432/mattermost?sslmode=disable&connect_timeout=10"``.
45+
- If you are using MySQL:
46+
1. Set ``DriverName"`` to ``"mysql"``
47+
2. Set ``"DataSource"`` to the following value, replacing ``<mmuser-password>`` and ``<host-name-or-IP>`` with the appropriate values:
48+
``"mmuser:<mmuser-password>@tcp(<host-name-or-IP>:3306)/mattermost?charset=utf8"``
49+
50+
7. Test the Mattermost server to make sure everything works.
51+
52+
a. Switch to the mattermost user: ``sudo su mattermost``
53+
b. Change to the ``bin`` directory: ``cd /opt/mattermost/bin``
54+
c. Start the Mattermost server: ``./platform``
55+
56+
When the server starts, it shows some log information and the text ``Server is listening on :8065``. You can stop the server by typing ``CTRL-C`` in the terminal window.
57+
58+
8. Set up Mattermost to use the systemd init daemon which handles
59+
supervision of the Mattermost process.
60+
61+
a. Create the Mattermost configuration file:
62+
63+
``sudo touch /etc/systemd/system/mattermost.service``
64+
65+
b. Open the configuration file in your favorite text editor, and copy the following lines into the file:
66+
67+
.. code-block:: none
68+
69+
[Unit]
70+
Description=Mattermost
71+
After=syslog.target network.target postgresql-9.4.service
72+
73+
[Service]
74+
Type=simple
75+
WorkingDirectory=/opt/mattermost/bin
76+
User=mattermost
77+
ExecStart=/opt/mattermost/bin/platform
78+
PIDFile=/var/spool/mattermost/pid/master.pid
79+
LimitNOFILE=49152
80+
81+
[Install]
82+
WantedBy=multi-user.target
83+
84+
c. Make the service executable.
85+
86+
``sudo chmod 664 /etc/systemd/system/mattermost.service``
87+
88+
d. Reload the systemd services.
89+
90+
``sudo systemctl daemon-reload``
91+
92+
f. Enable the Mattermost service.
93+
94+
``sudo chkconfig mattermost on``
95+
96+
g. Set Mattermost to start on boot.
97+
98+
``sudo systemctl enable mattermost``
99+
100+
9. Start the Mattermost server.
101+
102+
``sudo systemctl start mattermost``
103+
104+
10. Verify that Mattermost is running.
105+
106+
``curl http://localhost:8065``
107+
108+
You should see the HTML that's returned by the Mattermost server.
109+
110+
Now that Mattermost is installed and running, it's time to create the admin user and configure Mattermost for use.

0 commit comments

Comments
 (0)