Skip to content

Commit b4b2840

Browse files
committed
Added RHEL 6.6 install, and added MySQL database install
1 parent 4c407c0 commit b4b2840

8 files changed

+308
-1
lines changed

source/guides/administrator.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Installing Mattermost
1212

1313
/install/requirements.rst
1414
Installing on Ubuntu 14.04 LTS </install/install-ubuntu-1404.rst>
15+
Installing on RHEL 6.6 </install/install-rhel-66.rst>
1516
/install/docker-local*
1617
/install/docker-ebs*
1718
/install/ee-install*

source/install/config-ssl-http2-nginx.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ You can use any certificate that you want, but these instructions show you how t
1212
1. Log into the server that hosts NGINX and open a terminal window.
1313
2. Install git.
1414

15-
``sudo apt-get install git``
15+
- If you are using Ubuntu or Debian: ``sudo apt-get install git``
16+
- If you are using RHEL: ``sudo yum install git``
1617

1718
3. Clone the Let's Encrypt repository on GitHub.
1819

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
.. _install-rhel-66-mysql:
2+
3+
Installing MySQL Database Server
4+
================================
5+
6+
You can install either MySQL or PostgreSQL. To install PostgreSQL, see :ref:`install-rhel-66-postgresql`
7+
8+
**To install MySQL 5.7 on RHEL 6.6:**
9+
10+
1. Log into the server that will host the database, and open a terminal window.
11+
12+
2. Download the MySQL Yum repository from dev.mysql.com.
13+
14+
``wget http://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm``
15+
16+
3. Install the Yum repository from the file that you downloaded.
17+
18+
``sudo yum localinstall mysql-community-release-el6-9.noarch.rpm``
19+
20+
4. Install MySQL.
21+
22+
``sudo yum install mysql-community-server``
23+
24+
5. Start the MySQL server.
25+
26+
``sudo service mysqld start``
27+
28+
.. note::
29+
1. The first time that you start MySQL, the superuser account ``'root'@'localhost'`` is created and a temporary password is generated for it.
30+
2. Also the first time that you start MySQL, the ``validate_password`` plugin is installed. The plugin forces passwords to contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.
31+
32+
6. Obtain the root password that was generated when you started MySQL for the first time.
33+
34+
``sudo grep 'temporary password' /var/log/mysqld.log``
35+
36+
7. Change the root password. Login with the password that you obtained from the previous step.
37+
38+
``mysql -u root -p``
39+
40+
8. Change the password. At the mysql prompt, type the following command. Be sure to replace ``Password42!`` with the password that you want to use.
41+
42+
``mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password42!';``
43+
44+
9. Set MySQL to start automatically when the machine starts.
45+
46+
``sudo chkconfig mysqld on``
47+
48+
10. Create the Mattermost user 'mmuser'.
49+
50+
``mysql> create user 'mmuser'@'%' identified by 'mmuser-password';``
51+
52+
.. note::
53+
1. Use a password that is more secure than 'mmuser-password'
54+
2. The '%' means that mmuser can connect from any machine on the network. However, it's more secure to use the IP address of the machine that hosts Mattermost. For example, if you install Mattermost on the machine with IP address 10.10.10.2, then use the following command:
55+
56+
``mysql> create user 'mmuser'@'10.10.10.2' identified by 'mmuser-password';``
57+
58+
11. Create the Mattermost database.
59+
60+
``mysql> create database mattermost;``
61+
62+
12. Grant access privileges to the user 'mmuser'
63+
64+
``mysql> grant all privileges on mattermost.* to 'mmuser'@'%';``
65+
66+
After the database is set up, you can install Mattermost server.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.. _install-rhel-66-nginx:
2+
3+
Installing NGINX Server
4+
=======================
5+
6+
In a production setting, use a proxy server for greater security and performance of Mattermost.
7+
8+
The main benefits of using a proxy are as follows:
9+
10+
- SSL termination
11+
- HTTP to HTTPS redirect
12+
- Port mapping ``:80`` to ``:8065``
13+
- Standard request logs
14+
15+
**To install NGINX on RHEL 6.6:**
16+
17+
1. Log into the server that will host the proxy, and open a terminal window.
18+
19+
3. Install NGINX on RHEL with
20+
21+
- ``sudo vi /etc/yum.repos.d/nginx.repo``
22+
- Copy the below into the file
23+
24+
::
25+
26+
[nginx]
27+
name=nginx repo
28+
baseurl=http://nginx.org/packages/rhel/6/$basearch/
29+
gpgcheck=0
30+
enabled=1
31+
32+
- ``sudo yum install nginx.x86_64``
33+
- ``sudo service nginx start``
34+
- ``sudo chkconfig nginx on``
35+
36+
4. Verify NGINX is running
37+
38+
- ``curl http://10.10.10.3``
39+
- You should see a *Welcome to NGINX!* page
40+
41+
**What to do next**
42+
43+
1. Map a fully qualified domain name (FQDN) such as ``mattermost.example.com`` to point to the NGINX server.
44+
2. Configure NGINX to proxy connections from the internet to the Mattermost Server.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.. _install-rhel-66-postgresql:
2+
3+
Installing PostgreSQL Database
4+
==============================
5+
6+
1. For the purposes of this guide we will assume this server has an IP
7+
address of ``10.10.10.1``
8+
9+
- **Optional:** if installing on the same machine substitute
10+
``10.10.10.1`` with ``127.0.0.1``
11+
12+
2. Install PostgreSQL 9.4+ (or MySQL 5.6+)
13+
14+
- ``sudo yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm``
15+
- ``sudo yum install postgresql94-server postgresql94-contrib``
16+
- ``sudo service postgresql-9.4 initdb``
17+
- ``sudo chkconfig postgresql-9.4 on``
18+
- ``sudo service postgresql-9.4 start``
19+
20+
3. PostgreSQL created a user account called ``postgres``. You will need
21+
to log into that account with:
22+
23+
- ``sudo -i -u postgres``
24+
25+
4. You can get a PostgreSQL prompt by typing:
26+
27+
- ``psql``
28+
29+
5. Create the Mattermost database by typing:
30+
31+
- ``postgres=# CREATE DATABASE mattermost;``
32+
33+
6. Create the Mattermost user by typing:
34+
35+
- ``postgres=# CREATE USER mmuser WITH PASSWORD 'mmuser_password';``
36+
37+
7. Grant the user access to the Mattermost database by typing:
38+
39+
- ``postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;``
40+
41+
8. You can exit out of PostgreSQL by typing:
42+
43+
- ``postgres=# \q``
44+
45+
9. You can exit the Postgres account by typing:
46+
47+
- ``exit``
48+
49+
10. Allow Postgres to listen on all assigned IP Addresses:
50+
51+
- ``sudo vi /var/lib/pgsql/9.4/data/postgresql.conf``
52+
- Uncomment ``listen_addresses`` and change ``localhost`` to ``\*``
53+
54+
11. Alter ``pg_hba.conf`` to allow the Mattermost Server to talk to the
55+
Postgres database:
56+
57+
- ``sudo vi /var/lib/pgsql/9.4/data/pg_hba.conf``
58+
- Add the following line to the ``IPv4 local connections``:
59+
- ``host all all 10.10.10.2/32 md5``
60+
61+
12. Reload Postgres database:
62+
63+
- ``sudo service postgresql-9.4 restart``
64+
65+
13. Attempt to connect with the new created user to verify everything
66+
looks good:
67+
68+
- ``psql --host=10.10.10.1 --dbname=mattermost --username=mmuser --password``
69+
- ``mattermost=> \q``
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _install-rhel-6-server:
2+
3+
Installing Red Hat Enterprise Linux 6.6
4+
=====================================================
5+
6+
Install RHEL 6.6 on each machine that hosts one or more of the components. In most cases you need the 64-bit version.
7+
8+
You can use the 32-bit version on a machine that hosts the database and proxy server, but the Mattermost server requires 64-bit.
9+
10+
**To install RHEL 6 Server:**
11+
12+
1. Download the appropriate ISO image from RedHat and burn it to a CD-ROM.
13+
14+
2. Boot the system from the CD-ROM drive and follow the on-screen prompts.
15+
16+
3. After the system is installed, make sure that it's up to date with the most recent security patches. Open a terminal window and issue the following commands:
17+
18+
- ``sudo yum update``
19+
- ``sudo yum upgrade``
20+
21+
Now that the system is up to date, you can install the database.

source/install/install-rhel-66.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. _install-rhel-66:
2+
3+
=================================
4+
Installing Mattermost on RHEL 6.6
5+
=================================
6+
7+
Install a production-ready Mattermost system on 1 to 3 machines.
8+
9+
.. include:: install-common-intro.rst
10+
11+
.. contents:: Install and configure the components in the following order. Note that you need only one database, either MySQL or PostgreSQL.
12+
:backlinks: top
13+
:local:
14+
15+
.. include:: install-rhel-66-server.rst
16+
.. include:: install-rhel-66-mysql.rst
17+
.. include:: install-rhel-66-postgresql.rst
18+
.. include:: install-rhel-66-mattermost.rst
19+
.. include:: config-mattermost-server.rst
20+
.. include:: config-tls-mattermost.rst
21+
.. include:: install-rhel-66-nginx.rst
22+
.. include:: config-proxy-nginx.rst
23+
.. include:: config-ssl-http2-nginx.rst

0 commit comments

Comments
 (0)