<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How To Install Mattermost on CentOS 8 with Nginx Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/how-to-install-mattermost-on-centos-8-with-nginx/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 20 Apr 2020 08:35:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Install Mattermost on CentOS 8 with Nginx</title>
		<link>https://www.osradar.com/how-to-install-mattermost-on-centos-8-with-nginx/</link>
					<comments>https://www.osradar.com/how-to-install-mattermost-on-centos-8-with-nginx/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 08:34:59 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[How To Install Mattermost on CentOS 8 with Nginx]]></category>
		<category><![CDATA[install nginx on centos linux]]></category>
		<category><![CDATA[Mattermost installation on Nginx]]></category>
		<category><![CDATA[Mattermost installation with nginx]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=19195</guid>

					<description><![CDATA[<p>Today we are going to learn that how to install Mattermost on CentOS 8 With Nginx. Mattermost is an Open Source platform where you can chat online, and perform different actions like sharing of data, searching and indexing. It provides the facility of Integrations with DevOps tools. It can be operated mostly on all devices [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-mattermost-on-centos-8-with-nginx/">How To Install Mattermost on CentOS 8 with Nginx</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today we are going to learn that<a href="https://www.osradar.com/?p=19195"> how to install Mattermost on CentOS 8</a> With Nginx. Mattermost is an Open Source platform where you can chat online, and perform different actions like sharing of data, searching and indexing. It provides the facility of Integrations with DevOps tools. It can be operated mostly on all devices like Android, Windows, Linux and Mac Operating systems. Let&#8217;s move towards the installation of Mattermost on our CentOS 8 system.</p>



<h3><strong>Step 1: Update your System</strong></h3>



<p>First of all as usual we do, update your system.</p>



<pre class="wp-block-verse">sudo yum -y update &amp;&amp; sudo yum -y upgrade</pre>



<p>Then reboot the system.</p>



<pre class="wp-block-verse">sudo reboot</pre>



<h3><strong>Step 2: Installing Database Server</strong></h3>



<p>As Mattermost requires a Database Server, so I&#8217;ll recommend you to choose MariaDB for this purpose. Install it by typing the given command in your terminal.</p>



<pre class="wp-block-verse">sudo yum -y install @mariadb<br>sudo systemctl enable --now mariadb<br>sudo mysql_secure_installation</pre>



<p>Once, you finished installing Database, simply log in to it to set up the database for the Mattermost to be used.</p>



<pre class="wp-block-verse">mysql -u root -p<br> CREATE DATABASE mattermost;<br> GRANT ALL PRIVILEGES ON mattermost.* TO mattermost@localhost IDENTIFIED BY 'Your_Password';<br> FLUSH PRIVILEGES;<br> QUIT;</pre>



<h3><strong>Step 3: Installing Mattermost</strong></h3>



<p>Now, start to install the Mattermost on your CentOS 8 system. First of all add the system user for managing the Mattermost service.</p>



<pre class="wp-block-verse">sudo useradd -d /opt/mattermost -U -M mattermost</pre>



<p>Then you can visit the<a href="https://mattermost.com/download/"> official download page</a> of Mattermost to see the latest version available and download it via wget command.</p>



<pre class="wp-block-verse">wget https://releases.mattermost.com/5.21.0/mattermost-5.21.0-linux-amd64.tar.gz</pre>



<p>Once, downloaded extract it with the help of tar command.</p>



<pre class="wp-block-verse">tar xvf mattermost-5.21.0-linux-amd64.tar.gz</pre>



<p>And then move the resultant to the <strong>/opt</strong> directory.</p>



<pre class="wp-block-verse">sudo mv mattermost /opt</pre>



<p>Then create a directory where users data like images and files they post on Mattermost would be stored.</p>



<pre class="wp-block-verse">sudo mkdir /opt/mattermost/data</pre>



<p>And apply the permissions</p>



<pre class="wp-block-verse">sudo chown -R mattermost:mattermost /opt/mattermost<br>sudo chmod -R g+w /opt/mattermost</pre>



<p>Now, configure the DB driver by editing the <strong>config.json </strong>file under <strong>/opt/mattermost/config/</strong></p>



<pre class="wp-block-verse">sudo nano /opt/mattermost/config/config.json</pre>



<p>Here do the two changes one is setting DriverName as &#8220;<strong>mysql</strong>&#8221; and the other is DataSource to the same as given below in config file </p>



<p>It would look like the given below </p>



<pre class="wp-block-verse">"SqlSettings": {<br>         "DriverName": "mysql",<br>         "DataSource": "mattermost:<strong>Your_Password</strong>@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",<br>         "DataSourceReplicas": [],<br>         "DataSourceSearchReplicas": [],<br>         "MaxIdleConns": 20,<br>         "ConnMaxLifetimeMilliseconds": 3600000,<br>         "MaxOpenConns": 300,<br>         "Trace": false,<br>         "AtRestEncryptKey": "myyti1r597i99qrk7eu91ywqhaawz4md",<br>         "QueryTimeout": 30<br>     },</pre>



<p>Now, switch to the Mattermost directory.</p>



<pre class="wp-block-verse">cd /opt/mattermost</pre>



<p>Then start the Matermost server.</p>



<pre class="wp-block-verse">sudo -u mattermost ./bin/mattermost</pre>



<p>Output:</p>



<p>You&#8217;ll see the similar output.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="724" height="477" src="https://www.osradar.com/wp-content/uploads/2020/03/2-30.png" alt="" class="wp-image-19372" srcset="https://www.osradar.com/wp-content/uploads/2020/03/2-30.png 724w, https://www.osradar.com/wp-content/uploads/2020/03/2-30-300x198.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/2-30-696x459.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/2-30-637x420.png 637w" sizes="(max-width: 724px) 100vw, 724px" /></figure></div>



<h3><strong>Step 4: Configuring systemd file for Mattermost</strong></h3>



<p>Now, create the systemd file.</p>



<pre class="wp-block-verse">sudo tee /etc/systemd/system/mattermost.service&lt;&lt;EOF<br> [Unit]<br> Description=Mattermost<br> After=syslog.target network.target mariadb.service<br> [Service]<br> Type=notify<br> WorkingDirectory=/opt/mattermost<br> User=mattermost<br> ExecStart=/opt/mattermost/bin/mattermost<br> PIDFile=/var/run/mattermost.pid<br> TimeoutStartSec=3600<br> LimitNOFILE=49152<br> [Install]<br> WantedBy=multi-user.target<br> EOF</pre>



<p>Then set the SELinux to the permissive mode or you can disable it.</p>



<pre class="wp-block-verse">sudo setenforce 0<br>
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config</pre>



<p>And run the following command to run the services.</p>



<pre class="wp-block-verse">sudo systemctl daemon-reload<br>sudo systemctl enable --now mattermost</pre>



<p>Verify the status by typing</p>



<pre class="wp-block-verse">systemctl status mattermost.service </pre>



<p>Output:</p>



<pre class="wp-block-verse">[sabi@localhost ~]$ systemctl status mattermost.service<br> ● mattermost.service - Mattermost<br>    Loaded: loaded (/etc/systemd/system/mattermost.service; enabled; vendor pres&gt;<br>    Active: <strong>active </strong>(running) since Wed 2020-04-01 09:29:54 EDT; 6min ago<br>  Main PID: 2142 (mattermost)<br>     Tasks: 28 (limit: 11343)<br>    Memory: 141.0M<br>    CGroup: /system.slice/mattermost.service<br>            ├─2142 /opt/mattermost/bin/mattermost<br>            └─2253 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64<br> Apr 01 09:29:56 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:29:57 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:29:57 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:29:59 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:02 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:09 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:19 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:25 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:29 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> Apr 01 09:30:39 localhost.localdomain mattermost[2142]: {"level":"info","ts":15&gt;<br> lines 1-20/20 (END)</pre>



<p>Also make sure that Mattermost is running by typing </p>



<pre class="wp-block-verse">curl http://localhost:8065</pre>



<p>Here you will see HTML  about the Mattermost.</p>



<h3><strong>Step 5: Configuring Nginx with Mattermost</strong></h3>



<p>To configure Nginx with mattermost, install it by</p>



<pre class="wp-block-verse">sudo dnf -y install epel-release<br>sudo dnf -y install nginx</pre>



<p>Then enable the Nginx services</p>



<pre class="wp-block-verse">sudo systemctl enable --now nginx</pre>



<p>And configure the Nginx Server as a Proxy Server to use it for the Mattermost. For this edit the <strong>mattermost.conf </strong>file.</p>



<pre class="wp-block-verse">sudo nano /etc/nginx/conf.d/mattermost.conf</pre>



<p>Then paste the below content into the file.</p>



<pre class="wp-block-verse">upstream backend {<br>    server 127.0.0.1:8065;<br>    keepalive 32;<br> }<br> proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;<br> server {<br>    listen 80;<br>    server_name    mattermost.example.com;<br> location ~ /api/v[0-9]+/(users/)?websocket$ {<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection "upgrade";<br>        client_max_body_size 50M;<br>        proxy_set_header Host $http_host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_set_header X-Frame-Options SAMEORIGIN;<br>        proxy_buffers 256 16k;<br>        proxy_buffer_size 16k;<br>        client_body_timeout 60;<br>        send_timeout 300;<br>        lingering_timeout 5;<br>        proxy_connect_timeout 90;<br>        proxy_send_timeout 300;<br>        proxy_read_timeout 90s;<br>        proxy_pass http://backend;<br>    }<br> location / {<br>        client_max_body_size 50M;<br>        proxy_set_header Connection "";<br>        proxy_set_header Host $http_host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_set_header X-Frame-Options SAMEORIGIN;<br>        proxy_buffers 256 16k;<br>        proxy_buffer_size 16k;<br>        proxy_read_timeout 600s;<br>        proxy_cache mattermost_cache;<br>        proxy_cache_revalidate on;<br>        proxy_cache_min_uses 2;<br>        proxy_cache_use_stale timeout;<br>        proxy_cache_lock on;<br>        proxy_http_version 1.1;<br>        proxy_pass http://backend;<br>    }<br> }</pre>



<p><strong>Note</strong>: Substitute the <strong>mattermost.example.com</strong> with your domain name.</p>



<p>Now, verify the Nginx syntax</p>



<pre class="wp-block-verse">sudo nginx -t<br>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>nginx: configuration file /etc/nginx/nginx.conf test is successful</pre>



<p>If everything results good, restart the nginx services.</p>



<pre class="wp-block-verse">sudo systemctl restart nginx</pre>



<p>And allow the firewall access on http &amp; https ports.</p>



<pre class="wp-block-verse">sudo firewall-cmd --add-service={http,https} --permanent<br>sudo firewall-cmd --reload</pre>



<p>Verify the Nginx status by</p>



<pre class="wp-block-verse">sudo systemctl status nginx<br>● nginx.service - The nginx HTTP and reverse proxy server<br>    Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor prese&gt;<br>    Active: active (running) since Wed 2020-04-01 09:55:27 EDT; 1min 56s ago<br>   Process: 4276 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)<br>   Process: 4274 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)<br>   Process: 4271 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status&gt;<br>  Main PID: 4277 (nginx)<br>     Tasks: 6 (limit: 11343)<br>    Memory: 10.2M<br>    CGroup: /system.slice/nginx.service<br>            ├─4277 nginx: master process /usr/sbin/nginx<br>            ├─4278 nginx: worker process<br>            ├─4279 nginx: worker process<br>            ├─4280 nginx: worker process<br>            ├─4281 nginx: worker process<br>            └─4282 nginx: cache manager process<br> Apr 01 09:55:27 localhost.localdomain systemd[1]: Starting The nginx HTTP and r&gt;<br> Apr 01 09:55:27 localhost.localdomain nginx[4274]: nginx: the configuration fil&gt;<br> Apr 01 09:55:27 localhost.localdomain nginx[4274]: nginx: configuration file /e&gt;<br> Apr 01 09:55:27 localhost.localdomain systemd[1]: Started The nginx HTTP and re&gt;<br> lines 1-21/21 (END)</pre>



<p>Now, you can access the Mattermost using the configured domain on Nginx.</p>



<pre class="wp-block-verse">$ curl mattermost.example.com</pre>



<h3><strong>Step 6: Configuring Mattermost Server</strong></h3>



<p>Let&#8217;s move towards the configuration of Mattermost Server on the configured domain.</p>



<pre class="wp-block-verse">http://mattermost.example.com</pre>



<p>Here you have to create an admin user on the first page. With the help of this user you can create and invite other users.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="380" height="582" src="https://www.osradar.com/wp-content/uploads/2020/04/3.png" alt="" class="wp-image-19394" srcset="https://www.osradar.com/wp-content/uploads/2020/04/3.png 380w, https://www.osradar.com/wp-content/uploads/2020/04/3-196x300.png 196w, https://www.osradar.com/wp-content/uploads/2020/04/3-274x420.png 274w" sizes="(max-width: 380px) 100vw, 380px" /></figure></div>



<p>Then select weather you want to create a team or you want to go to the console.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="470" height="376" src="https://www.osradar.com/wp-content/uploads/2020/04/4-no-edit-1.png" alt="" class="wp-image-19416" srcset="https://www.osradar.com/wp-content/uploads/2020/04/4-no-edit-1.png 470w, https://www.osradar.com/wp-content/uploads/2020/04/4-no-edit-1-300x240.png 300w" sizes="(max-width: 470px) 100vw, 470px" /></figure></div>



<p>Click on the Create a Team button and after providing the team name hit &#8220;<strong>Next</strong>&#8220;:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="491" height="378" src="https://www.osradar.com/wp-content/uploads/2020/04/5-no-edit-1.png" alt="" class="wp-image-19417" srcset="https://www.osradar.com/wp-content/uploads/2020/04/5-no-edit-1.png 491w, https://www.osradar.com/wp-content/uploads/2020/04/5-no-edit-1-300x231.png 300w" sizes="(max-width: 491px) 100vw, 491px" /></figure></div>



<p>Then provide the team link and hit &#8220;<strong>Finish</strong>&#8221; button.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="626" height="487" src="https://www.osradar.com/wp-content/uploads/2020/04/6-1.png" alt="" class="wp-image-19418" srcset="https://www.osradar.com/wp-content/uploads/2020/04/6-1.png 626w, https://www.osradar.com/wp-content/uploads/2020/04/6-1-300x233.png 300w, https://www.osradar.com/wp-content/uploads/2020/04/6-1-540x420.png 540w" sizes="(max-width: 626px) 100vw, 626px" /></figure></div>



<p>You will be directed towards the dashboard of Mattermost.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1024" height="568" src="https://www.osradar.com/wp-content/uploads/2020/04/7-1-1024x568.png" alt="" class="wp-image-19447" srcset="https://www.osradar.com/wp-content/uploads/2020/04/7-1-1024x568.png 1024w, https://www.osradar.com/wp-content/uploads/2020/04/7-1-300x166.png 300w, https://www.osradar.com/wp-content/uploads/2020/04/7-1-768x426.png 768w, https://www.osradar.com/wp-content/uploads/2020/04/7-1-696x385.png 696w, https://www.osradar.com/wp-content/uploads/2020/04/7-1-758x420.png 758w, https://www.osradar.com/wp-content/uploads/2020/04/7-1.png 1032w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>Here you can perform various tasks like inviting the new members, installing apps for PC. Mac, iOS and Android. It provides easy access as well as notification on the go.</p>



<h3><strong>Step 7: Configuring Let&#8217;s Encrypt SSL Certificate</strong></h3>



<p>As for security reasons I recommend you to install SSL Certificates. So, that the communication must be encrypted.</p>



<pre class="wp-block-verse">wget https://dl.eff.org/certbot-auto<br>chmod +x certbot-auto<br>sudo mv certbot-auto /usr/local/bin</pre>



<p>Next stop the Nginx services.</p>



<pre class="wp-block-verse">sudo systemctl stop nginx</pre>



<p>After it set up the procedure to get notified on expiry and obtain a free SSL certificate by setting up your domain name along with these.</p>



<pre class="wp-block-verse">export DOMAIN="mattermost.example.com"<br>
export EMAIL_ALERTS="admin@example.com"<br>
sudo /usr/local/bin/certbot-auto certonly --standalone -d $DOMAIN --preferred-challenges http --agree-tos -n -m $EMAIL_ALERTS --keep-until-expiring</pre>



<p>And update your Nginx configuration file to Encrypt with SSL.</p>



<p>Then restart the Nginx services.</p>



<pre class="wp-block-verse">sudo systemctl restart nginx.</pre>



<p>Now, you can access the Mattermost over Secured SSL certificate via https. Visit the <a href="https://docs.mattermost.com/">Mattermost documentation</a> for more details.</p>



<p>So, this is how you can install and configure Mattermost with Nginx on CentOS 8.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-mattermost-on-centos-8-with-nginx/">How To Install Mattermost on CentOS 8 with Nginx</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-mattermost-on-centos-8-with-nginx/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
