|
| 1 | +.. _install-rhel-66-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** |
| 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. Setup Mattermost to use the Upstart daemon which handles supervision of the Mattermost process. |
| 59 | + |
| 60 | + a. Create the Mattermost configuration file: ``sudo touch /etc/init/mattermost.conf`` |
| 61 | + b. Open the configuration file in your favorite text editor, and copy the following lines into the file: |
| 62 | + |
| 63 | + .. code-block:: none |
| 64 | + |
| 65 | + start on runlevel [2345] |
| 66 | + stop on runlevel [016] |
| 67 | + respawn |
| 68 | + limit nofile 50000 50000 |
| 69 | + chdir /opt/mattermost |
| 70 | + exec bin/platform |
| 71 | +
|
| 72 | +9. Start the Mattermost server. |
| 73 | + |
| 74 | + ``sudo start mattermost`` |
| 75 | + |
| 76 | +10. Verify that Mattermost is running. |
| 77 | + |
| 78 | + ``curl http://localhost:8065`` |
| 79 | + |
| 80 | + You should see the HTML that's returned by the Mattermost server. |
| 81 | + |
| 82 | +Now that Mattermost is installed and running, it's time to create the admin user and configure Mattermost for use. |
0 commit comments