官方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


  • 2020-04-17 10:20:47

    GreenSocks Animation Platform详细工作机制以及TweenMax用法

    GSAP(GreenSocks Animation Platform)是一个性能较好的前端动画库。最近在写一个前端SVG动画编辑器时选择了它作为底层的动画库。为了减少踩坑,我大致浏览了它的源代码,这篇文章主要是对我的理解进行记录。 我会先简单介绍一下这个动画库的API,再介绍它的插件机制,最后会从一个用例出发跟踪其运行机制。

  • 2020-04-17 10:39:02

    CSS 滤镜技巧与细节,实现火焰,融合等特效

    简单来说,CSS 滤镜就是提供类似 PS 的图形特效,像模糊,锐化或元素变色等功能。通常被用于调整图片,背景和边界的渲染。本文就会围绕这些滤镜展开,看看具体能怎么使用或者玩出什么花活。

  • 2020-04-17 10:42:29

    (三)TweenMax运动效果

    运动效果 实例化对象.set() 立刻运动到指定地点,不用加时间

  • 2020-04-17 11:19:55

    Vue中的is和操作DOM

    vue中is的属性引入是为了解决dom结构中对放入html的元素有限制的问题,譬如ul里面要接上li的标签,引入is的属性后,你完全可以写成这样

  • 2020-04-17 11:27:48

    TweenMax中文初级教程一

    TweenMax.js集成了GreenSock动画平台的大部分核心功能,且具有极高的兼容性。

  • 2020-04-17 11:28:35

    TweenMax中文初级教程二

    TimelineMax是GreenSock 动画平台中的动画组织、排序、管理工具,可创建时间轴(timeline)作为动画或其他时间轴的容器,这使得整个动画控制和精确管理时间变得简单,避免了通过反复delay和回调进行动画。 作者:李霖弢 链接:https://www.jianshu.com/p/8c0361e43bf5 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

  • 2020-04-17 11:28:57

    TweenMax中文初级教程三

    动画关键词:CSS(一般可以省略) CSSPlugin用于在TweenMax中对DOM元素的CSS相关属性进行动画 在CSSPlugin中CSS属性需要写成驼峰式,例如font-size应当写作fontSize。有时候你可以在一些默认px为单位的属性中省略单位,CSSPlugin还可以在不同的单位间做动画:

  • 2020-04-17 11:29:23

    TweenMax中文初级教程四

    用于滚动窗口(类似于window.scrollTo(x, y))或DOM元素(如myDiv.scrollTop = y; myDiv.scrollLeft = x;)。滚动窗口时使用window作为动画目标。

  • 2020-04-17 14:06:29

    图片解释EaseIn,EaseOut,EaseInOut

    1.EaseIn:即缓动发生在入口处,也就是刚开始的时候。 2.EaseOut:即缓动发生在出口处,也就是结束之前。 3.EaseInOut:就是两边都有缓动了.

  • 2020-04-21 14:47:13

    Redis危险命令重命名、禁用

    flushdb,清空数据库 flushall,清空所有记录,数据库 config,客户端连接后可配置服务器 keys,客户端连接后可查看所有存在的键