10

Rocket.Chat open source , Meteor. Rocket.Chat Slack, , Linux, Windows, macOS, Android iOS.

   Rocket.Chat  Linux

Rocket.Chat

  • API

:

  • LDAP
  • 2FA
  • SSO
  • Oauth

Rocket.Chat Linux.


1. Snap Linux

Snaps. snapd c .

$ sudo apt install snapd		#Ubuntu  Debian
$ sudo dnf install snapd		#Fedora 22+/CentOS/RHEL 8
$ sudo yum install snapd		#CentOS/RHEL 7	

systemd, . .

$ sudo systemctl enable --now snapd.socket

2: Rocket.Chat Linux

rocketchat-server :

$ sudo snap install rocketchat-server

snap , rocket.chat 3000. - , rocket.chat GUI.

http://SERVER_IP:3000

: , , .

Admin Info

: , , , , .

Orgainzation Info

- , , , 2FA.

Server Info

. . - , Rocket.Chat - , , .

Register Server

, , Go to your workspace ( )

Go to your workspace

.

Workspace

3: Rocket.Chat

-, nginx Apache, Rocket.Chat . Rocket.Chat , SSL/TLS. - SSL/TLS HTTPS.

Nginx Rocket.Chat

Nginx.

$ sudo apt apt install nginx	#Ubuntu/Debian 
$ sudo dnf install nginx		#Fedora 22+/CentOS/RHEL 8
$ sudo yum install nginx		#CentOS/RHEL 7

Nginx,

$ sudo systemctl enable --now nginx
$ sudo systemctl status nginx

block Rocket.Chat, , /etc/nginx/conf.d/.

$ sudo vim /etc/nginx/conf.d/chat.merionet.com.conf

, .

upstream backend {
    server 127.0.0.1:3000;
}

server {
    listen 80;
    server_name chat.merionet.com;

    # You can increase the limit if you need to.
    client_max_body_size 200M;

    error_log /var/log/nginx/chat.merionet.com.log;

    location / {
        proxy_pass http://backend/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;
        proxy_redirect off;
    }
}

Nginx.

$ sudo nginx -t
$ sudo systemctl restart nginx

Apache Rocket.Chat

Apache2

$ sudo apt install apache2		#Ubuntu/Debian 
$ sudo dnf install httpd		#Fedora 22+/CentOS/RHEL 8
$ sudo yum install httpd		#CentOS/RHEL 7	

apache , .

-----  Ubuntu/Debian -----
$ sudo systemctl enable --now apache2 	
$ sudo systemctl status apache2

-----  CentsOS/RHEL 7/8 ----- 
$ sudo systemctl enable --now httpd
$ sudo systemctl status httpd

Rocket.Chat, , /etc/apache2/sites-available/ /etc/httpd/conf.d/.

-----  Ubuntu/Debian -----
$ sudo vim /etc/apache2/sites-available/chat.merionet.com.conf

-----  CentsOS/RHEL 7/8 ----- 
$ sudo vim /etc/httpd/conf.d/chat.merionet.com.conf	

, .

<VirtualHost *:80>
    ServerAdmin admin@merionet.ru
    ServerName chat.merionet.com

    LogLevel info
    ErrorLog /var/log/chat.merionet.com_error.log
    TransferLog /var/log/chat.merionet.com_access.log

    <Location />
        Require all granted
    </Location>

    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /(.*)           http://localhost:3000/$1 [P,L]

    ProxyPassReverse /          http://localhost:3000/
</VirtualHost>	

Ubuntu Debian apache2 .

$ sudo a2enmod proxy_http
$ sudo a2enmod proxy_wstunnel
$ sudo a2enmod rewrite
$ sudo systemctl restart apache2

CentOS/RHEL Fedora apache.

# systemctl restart httpd	

Rocket.Chat , -.

http://chat.merionet.com
Login

4: Rocket.Chat

Rocket.Chat. Linux, deb (x64) rpm (x64) Linux.

$ wget -c https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/2.17.7/rocketchat_2.17.7_amd64.deb

$ wget -c https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/2.17.7/rocketchat-2.17.7.x86_64.rpm	

dpkg rpm

$ sudo dpkg -i rocketchat_2.17.7_amd64.deb      #Ubuntu/Debian
$ sudo rpm -i rocketchat-2.17.7.x86_64.rpm      #CentOS/RedHat

Rocket.Chat

Rocket.Chat Snaps, .

Node.js

:

sudo apt update

Node.js, npm , npm :

sudo apt install nodejs npm build-essential curl software-properties-common graphicsmagick

n, npm, Node.js. , n Node.js:

sudo npm install -g inherits n
sudo n 8.11.3

MongoDB

MongoDB - - NoSQL, Rocket.Chat .

MongoDB MongoDB:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
sudo add-apt-repository 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse'

apt MongoDB, :

sudo apt update
sudo apt install mongodb-org	

MongoDB:

sudo systemctl start mongod
sudo systemctl enable mongod	

rocket, Rocket.Chat.

sudo useradd -m -U -r -d /opt/rocket rocket

www-data /opt/rocket, Nginx Rocket.Chat:

sudo usermod -a -G rocket www-data
sudo chmod 750 /opt/rocket	

Rocket.Chat

rocket

sudo su - rocket

Rocket.Chat curl:

curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz

Rocket.Chat:

tar zxf rocket.chat.tgz
mv bundle Rocket.Chat

Rocket.Chat/programs/server npm:

cd Rocket.Chat/programs/server
npm install

systemd Nginx Apache, Rocket.Chat

export PORT=3000
export ROOT_URL=http://0.0.0.0:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat	

Rocket.Chat Rocket.Chat, :

cd ../../
node main.js

, :

? +---------------------------------------------+
? |                SERVER RUNNING               |
? +---------------------------------------------+
? |                                             |
? |  Rocket.Chat Version: 0.71.1                |
? |       NodeJS Version: 8.11.3 - x64          |
? |             Platform: linux                 |
? |         Process Port: 3000                  |
? |             Site URL: http://0.0.0.0:3000/  |
? |     ReplicaSet OpLog: Disabled              |
? |          Commit Hash: e73dc78ffd            |
? |        Commit Branch: HEAD                  |
? |                                             |
? +---------------------------------------------+	

Rocket.Chat Ctrl+C sudo, exit.

Systemd

Rocket.Chat , rocketchat.service /etc/systemd/system/.

sudo nano /etc/systemd/system/rocketchat.service

:

[Unit]
Description=Rocket.Chat server
After=network.target nss-lookup.target mongod.target

[Service]
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocket
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=https://chat.merionet.com PORT=3000
ExecStart=/usr/local/bin/node /opt/rocket/Rocket.Chat/main.js

[Install]
WantedBy=multi-user.target

systemd, , Rocket.Chat, :

sudo systemctl daemon-reload
sudo systemctl start rocketchat	

:

sudo systemctl status rocketchat

:

* rocketchat.service - Rocket.Chat server
   Loaded: loaded (/etc/systemd/system/rocketchat.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-11-07 14:36:24 PST; 5s ago
 Main PID: 12693 (node)
    Tasks: 10 (limit: 2319)
   CGroup: /system.slice/rocketchat.service
           `-12693 /usr/local/bin/node /opt/rocket/Rocket.Chat/main.js	

, Rocket.Chat :

sudo systemctl enable rocketchat

, Rocket.Chat , , 3.


, Rocket.Chat Linux Nginx Apache .

Rocket.Chat .


>