diff options
author | Corey Hulen <corey@hulen.com> | 2015-12-17 12:04:05 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-12-17 12:04:05 -0800 |
commit | 19a6481e97f1355446b2a9901a22ab5172b104b8 (patch) | |
tree | 2064f720db08ee63f95465a2dcb45c231f74f1f1 /doc/install/Production-RHEL.md | |
parent | 08f330de2f9e2412107a466b54cbc2df2ab6c741 (diff) | |
parent | bfdd95948c21bad4dc4ab3c6484a6b37cf0157ab (diff) | |
download | chat-19a6481e97f1355446b2a9901a22ab5172b104b8.tar.gz chat-19a6481e97f1355446b2a9901a22ab5172b104b8.tar.bz2 chat-19a6481e97f1355446b2a9901a22ab5172b104b8.zip |
Merge pull request #1747 from mattermost/RHEL-tweaks
Minor updates to RHEL instructions
Diffstat (limited to 'doc/install/Production-RHEL.md')
-rw-r--r-- | doc/install/Production-RHEL.md | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/doc/install/Production-RHEL.md b/doc/install/Production-RHEL.md index a7b34691b..7d3a1b9ca 100644 --- a/doc/install/Production-RHEL.md +++ b/doc/install/Production-RHEL.md @@ -8,7 +8,7 @@ * ``` sudo yum upgrade``` ## Set up Database Server -1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.1 +1. For the purposes of this guide we will assume this server has an IP address of `10.10.10.1` - **Optional:** if installing on the same machine substitute `10.10.10.1` with `127.0.0.1` 1. Install PostgreSQL 9.4+ (or MySQL 5.6+) * ``` sudo yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm``` @@ -27,42 +27,42 @@ 1. Grant the user access to the Mattermost database by typing: * ```postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;``` 1. You can exit out of PostgreSQL by typing: - * ```postgre=# \q``` -1. You can exit the postgres account by typing: + * ```postgres=# \q``` +1. You can exit the Postgres account by typing: * ``` exit``` -1. Allow Postgres to listen on all assigned IP Addresses +1. Allow Postgres to listen on all assigned IP Addresses: * ```sudo vi /var/lib/pgsql/9.4/data/postgresql.conf``` * Uncomment 'listen_addresses' and change 'localhost' to '*' -1. Alter pg_hba.conf to allow the mattermost server to talk to the postgres database +1. Alter `pg_hba.conf` to allow the Mattermost Server to talk to the Postgres database: * ```sudo vi /var/lib/pgsql/9.4/data/pg_hba.conf``` - * Add the following line to the 'IPv4 local connections' + * Add the following line to the 'IPv4 local connections': * host all all 10.10.10.2/32 md5 -1. Reload Postgres databasejh +1. Reload Postgres database: * ```sudo systemctl reload postgresql-9.4.service``` -1. Attempt to connect with the new created user to verify everything looks good +1. Attempt to connect with the new created user to verify everything looks good: * ```psql --host=10.10.10.1 --dbname=mattermost --username=mmuser --password``` * ```mattermost=> \q``` ## Set up Mattermost Server -1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.2 +1. For the purposes of this guide we will assume this server has an IP address of `10.10.10.2` 1. Download the latest Mattermost Server by typing: * ``` wget https://github.com/mattermost/platform/releases/download/v1.3.0/mattermost.tar.gz``` -1. Install Mattermost under /opt +1. Install Mattermost under `/opt` * Unzip the Mattermost Server by typing: * ``` tar -xvzf mattermost.tar.gz``` * ``` sudo mv mattermost /opt``` 1. Create the storage directory for files. We assume you will have attached a large drive for storage of images and files. For this setup we will assume the directory is located at `/opt/mattermost/data`. * Create the directory by typing: * ``` sudo mkdir -p /opt/mattermost/data``` -1. Create a system user and group called mattermost that will run this service +1. Create a system user and group called mattermost that will run this service: * ``` sudo useradd -r mattermost -U``` - * Set the mattermost account as the directory owner by typing: + * Set the Mattermost account as the directory owner by typing: * ``` sudo chown -R mattermost:mattermost /opt/mattermost``` * ``` sudo chmod -R g+w /opt/mattermost``` * Add yourself to the mattermost group to ensure you can edit these files: * ``` sudo usermod -aG mattermost USERNAME``` -1. Configure Mattermost Server by editing the config.json file at /opt/mattermost/config +1. Configure Mattermost Server by editing the `config.json` file at `/opt/mattermost/config` * ``` cd /opt/mattermost/config``` * Edit the file by typing: * ``` sudo vi config.json``` @@ -74,8 +74,8 @@ * Run the Mattermost Server by typing: * ``` ./platform``` * You should see a console log like `Server is listening on :8065` letting you know the service is running. - * Stop the server for now by typing `ctrl-c` -1. Setup Mattermost to use the systemd init daemon which handles supervision of the Mattermost process + * Stop the server for now by typing `Ctrl-C` +1. Set up Mattermost to use the systemd init daemon which handles supervision of the Mattermost process: * ``` sudo touch /etc/systemd/system/mattermost.service``` * ``` sudo vi /etc/systemd/system/mattermost.service``` * Copy the following lines into `/etc/systemd/system/mattermost.service` @@ -97,14 +97,14 @@ WantedBy=default.target ``` * Make sure the service is executable with ``` sudo chmod 664 /etc/systemd/system/mattermost.service``` * Reload the services with `sudo systemctl daemon-reload` - * Start mattermost service with `sudo systemctl start mattermost.service` + * Start Mattermost Service with `sudo systemctl start mattermost.service` ## Set up Nginx Server -1. For the purposes of this guide we will assume this server has an IP address of 10.10.10.3 +1. For the purposes of this guide we will assume this server has an IP address of `10.10.10.3` 1. We use Nginx for proxying request to the Mattermost Server. The main benefits are: * SSL termination - * http to https redirect + * HTTP to HTTPS redirect * Port mapping :80 to :8065 * Standard request logs 1. Install Nginx on RHEL with @@ -144,14 +144,14 @@ enabled=1 } } ``` - * Remove the existing file with + * Remove the existing file with: * ``` sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak``` * Restart Nginx by typing: * ``` sudo service nginx restart``` * Verify you can see Mattermost thru the proxy by typing: * ``` curl http://localhost``` * You should see a page titles *Mattermost - Signup* - * Not seeing the page? look for errors with ``` sudo cat /var/log/audit/audit.log | grep nginx | grep denied``` + * Not seeing the page? Look for errors with ``` sudo cat /var/log/audit/audit.log | grep nginx | grep denied``` * **Optional** if you're running on the same server as the Mattermost server and see 502 errors you may need to run `setsebool -P httpd_can_network_connect true` because SELinux is preventing the connection ## Set up Nginx with SSL (Recommended) @@ -198,9 +198,8 @@ enabled=1 proxy_set_header X-Forwarded-Ssl on; ``` - ## Finish Mattermost Server setup -1. Navigate to https://mattermost.example.com and create a team and user. +1. Navigate to `https://mattermost.example.com` and create a team and user. 1. The first user in the system is automatically granted the `system_admin` role, which gives you access to the System Console. 1. From the `town-square` channel click the dropdown and choose the `System Console` option 1. Update Email Settings. We recommend using an email sending service. The example below assumes AmazonSES. @@ -214,13 +213,13 @@ enabled=1 * Set *SMTP Port* to `465` * Set *Connection Security* to `TLS` * Save the Settings -1. Update File Settings +1. Update File Settings: * Change *Local Directory Location* from `./data/` to `/opt/mattermost/data` -1. Update Log Settings. - * Set *Log to The Console* to false -1. Update Rate Limit Settings. +1. Update Log Settings: + * Set *Log to The Console* to `false` +1. Update Rate Limit Settings: * Set *Vary By Remote Address* to false * Set *Vary By HTTP Header* to X-Real-IP -1. Feel free to modify other settings. +1. Feel free to modify other settings 1. Restart the Mattermost Service by typing: * ``` sudo restart mattermost``` |