官方Rocket.Chat安装教程

2020-11-17 10:11:26

安装教程地址 https://docs.rocket.chat/installation/manual-installation/centos

不要先安装mongodb,什么都不要做,一个纯净的linux空间,

按照下面步骤安装,很快就安装成功,一步步来,会给你节省很多时间。


Rocket.Chat in CentOS

This installation guide was tested in the following environment:

  • Rocket.Chat 3.0.0

  • OS: CentOS 7.6

  • Mongodb 4.0.9

  • NodeJS 12.14.0

Install necessary dependency packages

Update package list and configure yum to install the official MongoDB packages with the following yum repository file:

sudo yum -y check-update

cat << EOF | sudo tee -a /etc/yum.repos.d/mongodb-org-4.0.repo[mongodb-org-4.0]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-4.0.ascEOF

Configure Node.js to be installed via package manager:

sudo yum install -y curl && curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

Install build tools, MongoDB, nodejs and graphicsmagick:

sudo yum install -y gcc-c++ make mongodb-org nodejs

sudo yum install -y epel-release && sudo yum install -y GraphicsMagick

Using npm install inherits and n, and the node version required by Rocket.Chat:

sudo npm install -g inherits n && sudo n 12.14.0

Install Rocket.Chat

Download the latest Rocket.Chat version:

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

tar -xzf /tmp/rocket.chat.tgz -C /tmp

Install (this guide uses /opt but feel free to choose a different directory):

cd /tmp/bundle/programs/server && npm install

sudo mv /tmp/bundle /opt/Rocket.Chat

Configure the Rocket.Chat service

Add the rocketchat user, set the right permissions on the Rocket.Chat folder and create the Rocket.Chat service file:

sudo useradd -M rocketchat && sudo usermod -L rocketchat

sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat

cat << EOF |sudo tee -a /lib/systemd/system/rocketchat.service[Unit]Description=The Rocket.Chat serverAfter=network.target remote-fs.target nss-lookup.target nginx.target mongod.target[Service]ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.jsStandardOutput=syslogStandardError=syslogSyslogIdentifier=rocketchatUser=rocketchatEnvironment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000[Install]WantedBy=multi-user.targetEOF

Open the Rocket.Chat service file just created (/usr/lib/systemd/system/rocketchat.service) using sudo and your favourite text editor, and change the ROOT_URL environmental variable to reflect the URL you want to use for accessing the server (optionally change MONGO_URL, MONGO_OPLOG_URL and PORT):

MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000PORT=3000

Setup storage engine and replication for MongoDB (mandatory for versions > 1), and enable and start MongoDB and Rocket.Chat:

sudo sed -i "s/^#  engine:/  engine: mmapv1/"  /etc/mongod.conf

sudo sed -i "s/^#replication:/replication:\n  replSetName: rs01/" /etc/mongod.conf

sudo systemctl enable mongod && sudo systemctl start mongod

mongo --eval "printjson(rs.initiate())"

sudo systemctl enable rocketchat && sudo systemctl start rocketchat

Optional configurations

Configure firewall rule Configure a HTTP reverse proxy to access Rocket.Chat server [Configure mongo access control] [Configure production values for mongodb]

Configure your Rocket.Chat server

Open a web browser and access the configured ROOT_URL (http://your-host-name.com-as-accessed-from-internet:3000), follow the configuration steps to set an admin account and your organization and server info.

ZLIB version problem

Some users had experienced problems starting rocketchat server in CentOS because their zlib version is not compatible with rocket.chat.

If you find an error message similar to the following in the logs:

Exception in callback of async function: Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found

Add this environmental variable in the Rocket.Chat service file (/usr/lib/systemd/system/rocketchat.service):

Environment=LD_PRELOAD=/opt/Rocket.Chat/programs/server/npm/node_modules/sharp/vendor/lib/libz.so


  • 2019-08-22 17:26:21

    详解javaScript的深拷贝

    最开始意识到深拷贝的重要性是在我使用redux的时候(react + redux), redux的机制要求在reducer中必须返回一个新的对象,而不能对原来的对象做改动,事实上,当时我当然不会主动犯这个错误,但很多时候,一不小心可能就会修改了原来的对象,例如:var newObj = obj; newObj.xxx = xxx 实际上,这个时候newObj和obj两个引用指向的是同一个对象,我修改了newObj,实际上也就等同于修改了obj,这,就是我和深浅拷贝的第一次相遇。

  • 2019-08-22 19:14:21

    Android Studio 3.5最新特性

    Android Studio(以下简称为AS) 3.5正式版终于发布了,从第一个bate版本发布到正式版本,历时三个半月。AS一直以来被开发者吐槽,因此谷歌也放慢了版本的变化,对测试版本进行大力度的优化,提高了稳定性。从3.3版本开始,谷歌启动了名为Project Marble的计划,意为谷歌团队致力于使集成开发环境(IDE)的基本功能和流程变得坚如磐石,同时精炼和完善面向用户的功能。而AS 3.5则是Project Marble主要成果的版本,下面来介绍主要成果。

  • 2019-08-27 05:43:13

    Laravel 门面自动补全工具 laravel-ide-helper

    当我们在 PhpStorm 编辑器中,开发 Laravel 框架的项目时,很多类方法都不能自动补全和定位,比如 Facade 门面的方法,DB::table()、Route::get() 等。

  • 2019-08-28 08:28:36

    Js apply,call方法详解,及其apply()方法的妙用

    在给对象参数的情况下,如果参数的形式是数组的时候,比如apply示例里面传递了参数arguments,这个参数是数组类型,并且在调用Person的时候参数的列表是对应一致的(也就是Person和Student的参数列表前两位是一致的) 就可以采用 apply , 如果我的Person的参数列表是这样的(age,name),而Student的参数列表是(name,age,grade),这样就可以用call来实现了,也就是直接指定参数列表对应值的位置(Person.call(this,age,name,grade));

  • 2019-08-28 08:49:47

    Nginx + fastcgi + php 的原理与关系

    CGI对每个请求会parse一遍对应脚本的配置文件(如php.ini), 加载配置和扩展,初始化执行环境,性能非常差,所有有了下面的流程: