Saturday, January 22, 2022

How To install Mattermost with Apache on Rocky Linux 8.5

 Mattermost is an open-source instant messaging service. It comes in both free and paid versions. It can be operated either in the cloud or on-premise as a web application.
Homepage - https://mattermost.com/
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      | IP -192.168.1.60        |Hostname - server.yourdomain.com
_________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y ; dnf install mysql-server httpd -y

systemctl start mysqld httpd ; systemctl enable mysqld httpd
mysql_secure_installation

mysql -u root -p
CREATE DATABASE matterdb;
CREATE USER 'matteruser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON matterdb.* TO matteruser@localhost;
FLUSH PRIVILEGES;
EXIT;

useradd --system --user-group mattermost
wget https://releases.mattermost.com/6.0.2/mattermost-6.0.2-linux-amd64.tar.gz ; tar -xf mattermost-6.0.2-linux-amd64.tar.gz ; mv mattermost /opt

mkdir /opt/mattermost/data ; chown -R mattermost:mattermost /opt/mattermost ; chmod -R g+w /opt/mattermost

nano /opt/mattermost/config/config.json
"SiteURL": "http://server.yourdomain.com",
    "DriverName": "mysql",
    "DataSource": "matteruser:password@tcp(localhost:3306)/matterdb?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",

nano /etc/systemd/system/mattermost.service
[Unit]
Description=Mattermost
After=syslog.target network.target mysqld.service

[Service]
Type=notify
WorkingDirectory=/opt/mattermost
User=mattermost
ExecStart=/opt/mattermost/bin/mattermost
PIDFile=/var/spool/mattermost/pid/master.pid
TimeoutStartSec=3600
LimitNOFILE=49152

[Install]
WantedBy=multi-user.target
systemctl daemon-reload ; systemctl start mattermost ; systemctl enable mattermost ; systemctl status mattermost

nano /etc/httpd/conf.d/example.conf
<VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName server.yourdomain.com    
        ErrorLog /var/log/httpd/error.log
        CustomLog /var/log/httpd/access.log combined
        ProxyRequests On
        ProxyPass / http://localhost:8065/
        ProxyPassReverse / http://localhost:8065/
</VirtualHost>
apachectl configtest ; echo "192.168.1.60 server.yourdomain.com" >> /etc/hosts
firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload        
systemctl restart httpd ; systemctl status httpd
http://server.yourdomain.com | admin/a7=DtPIsp>ir1j!  
__________________________________________________________________________________________

No comments:

Post a Comment