Rocket.Chat


官方给出的文档也个人觉得太麻烦了,并且对ubuntu的支持程度远高于CentOS,自己就折腾写了个安装的笔记,如果是在公司内部或者是部门内部还是很有用处的,比较看中的功能有和gitlab或github的整合,以及注册认证和消息邮件外发

官方文档:https://rocket.chat/docs/installation/manual-installation/centos/

环境依赖

  • CentOS6.5
  • Nginx
  • Mongodb v2

安装步骤

  • 安装Mongodb
vim /etc/yum.repos.d/mongodb.repo

写入以下内容

[mongodb-org]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

Run

yum -y install epel-release curl GraphicsMagick npm mongodb-org-server mongodb-org gcc-c++

提前配置数据库

mongo
>use rocketchat //添加数据库
>exit
service mongod restart
  • 安装node.js

这里就按照官方给出的文档安装了,那个有点麻烦

curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
yum -y install nodejs
  • 安装Rocket.Chat
cd /opt

curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tar.gz
tar zxvf rocket.chat.tgz mv bundle Rocket.Chat
cd Rocket.Chat/programs/server npm install cd ../..

配置 PORT, ROOT_URL and MONGO_URL:

export PORT=3000
export ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/
export MONGO_URL=mongodb://localhost:27017/rocketchat

启动服务

service mongod restart && chkconfig mongod on
service nginx start && chkconfig nginx on
  • 启动服务
node main.js

现在就能登录http://your-host-name.com-as-accessed-from-internet:3000/进行访问了

配置Nginx+SSL代理

  • 安装nginx
yum -y install nginx
  • 配置Nginx

创建自签证书

首先,创建证书和私钥的目录
# mkdir -p /etc/nginx/cert
# cd /etc/nginx/cert
创建服务器私钥,命令会让你输入一个口令:
# openssl genrsa -des3 -out nginx.key 2048
创建签名请求的证书(CSR):
# openssl req -new -key nginx.key -out nginx.csr
在加载SSL支持的Nginx并使用上述私钥时除去必须的口令:
# cp nginx.key nginx.key.org
# openssl rsa -in nginx.key.org -out nginx.key
最后标记证书使用上述私钥和CSR:
# openssl x509 -req -days 365 -in nginx.csr -signkey nginx.key -out nginx.crt

配置rocketchat.conf

vim /etc/nginx/nginx.d/rocketchat.conf

注意将默认的default.conf删除掉,不然影响80端口

server {
listen 80;
server_name im.mydomain.com;
return 301 https://$host$request_uri;
} # HTTPS Server
server {
listen 443;
server_name im.mydomain.com;
error_log off; ssl on;
ssl_certificate /etc/nginx/cert/nginx.crt;
ssl_certificate_key /etc/nginx/cert/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; location / {
proxy_pass http://127.0.0.1:3000/;
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-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true; proxy_redirect off;
}
}

Auto Start Rocket.Chat

  • CentOS7

CentOS7下推荐如下配置,添加一个服务项:

[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=root
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ PORT=3000
[Install]
WantedBy=multi-user.target

Now you can enable this service by running:

systemctl enable rocketchat.service
systemctl start rocketchat.service
  • CentOS6

CentOS6下推荐使用Supervisor服务,需要我们写个脚本来自动执行,这样的话就能免去很多步骤

安装supervisor

yum install supervisor

编辑脚本并添加执行全权限

vim /opt/Rocket.Chat/start.sh

chmod +x /opt/Rocket.Chat/start.sh

脚本内容如下

#/bin/bash
cd /opt/Rocket.Chat/
export PORT=3000
export ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ //根据自己的环境修改配置
export MONGO_URL=mongodb://localhost:27017/rocketchat
node /opt/Rocket.Chat/main.js

配置supervisord服务

vim /etc/supervisord.conf

在最后添加一下内容

[program:rocketchat]
command=bash /opt/Rocket.Chat/start.sh
directory=/opt/Rocket.Chat
autostart=true
autorestart=true
logfile=/var/log/supervisor/rocketchat.log
log_stderr=true
user=root

启动supervisord

service supervisord start && chkconfig supervisord on

此时rocket也就一起起来了

Rocket.Chat 开源IM系统部署的更多相关文章

  1. OpenVAS开源风险评估系统部署方案

    OpenVAS,即开放式漏洞评估系统,是一个用于评估目标漏洞的杰出框架.功能十分强大,最重要的是,它是“开源”的——就是免费的意思啦- 它与著名的Nessus“本是同根生”,在Nessus商业化之后仍 ...

  2. Linux记录-open-falcon开源监控系统部署

    参考https://book.open-falcon.org/zh_0_2/quick_install/prepare.html一.安装后端1.环境准备yum -y install redisyum ...

  3. Centos7部署开源聊天软件rocket.chat

    一.部署rocket.chat 1.看官方文档部署,很简单,一步一步跟着部署即可 注意:需要部署节点需要联网主要是yum方式 https://rocket.chat/docs/installation ...

  4. Slack 开源替代品 Rocket.Chat(聊天,文件上传等等)

    Rocket.Chat 是特性最丰富的 Slack 开源替代品之一. 主要功能:群组聊天,直接通信,私聊群,桌面通知,媒体嵌入,链接预览,文件上传,语音/视频 聊天,截图等等. Rocket.Chat ...

  5. 免费开源《OdooERP系统部署架构指南》试读:第一章 Odoo架构概述

    文/开源智造联合创始人老杨 本文来自<OdooERP系统部署架构指南>的试读章节.书籍尚未出版,请勿转载.欢迎您反馈阅读意见. 从web浏览器到PostgreSQL,多层与其他层交互以处理 ...

  6. RocketChat:开源聊天软件部署

    1. 简介 RocketChat是一款优秀的开源聊天软件.支持各种平台,IOS.Android.Web.Mac.Windows以及Linux,安装部署简单,功能简单易用,目前部分功能还在完善当中,特别 ...

  7. Mac 下安装运行Rocket.chat

    最近花了一周的时间,复习了HTML.CSS.原生JS,并学习了Node.js.CoffeeScript.js.MongoDB,入了下门. 因为准备在Rocket.chat 上做二次开发,所以先下载和安 ...

  8. Centos7 使用Docker安装rocket.chat聊天工具

    镜像下载.域名解析.时间同步请点击阿里云开源镜像站 下载安装 Rocket.Chat 目前最新的版本为 4.0.1,可以通过手动或者容器的方式安装.这里我推荐使用容器,部署过程会方便不少. 如果要用容 ...

  9. Linux系统部署规范v1.0

    Linux系统部署规范v1.0 目的: 1.尽可能减少线上操作: 2.尽可能实现自动化部署: 3.尽可能减少安装服务和启动的服务: 4.尽可能使用安全协议提供服务: 5.尽可能让业务系统单一: 6.尽 ...

随机推荐

  1. 实验楼----PHP大法

    地址:http://www.shiyanbar.com/ctf/2008 题目:http://ctf5.shiyanbar.com/DUTCTF/index.php

  2. [转帖]Docker的数据管理(volume/bind mount/tmpfs)

    Docker(十五)-Docker的数据管理(volume/bind mount/tmpfs) https://www.cnblogs.com/zhuochong/p/10069719.html do ...

  3. Ubuntu18.04安装mysql5.7

    Ubuntu18.04安装mysql5.7 1.1安装 首先执行下面三条命令: # 安装mysql服务 sudo apt-get install mysql-server # 安装客户端 sudo a ...

  4. 错误模块名称: KERNELBASE.dll错误

    今天在部署一个C/S程序的时候出了bug,日志都没有记载:本地调试当然是没问题的,所以不是代码问题,百度之发现KERNELBASE.dll这个文章说的比较靠谱,仔细研究了自己的配置文件后,果然是配置文 ...

  5. ArrayList 初学小结!

    package good.com; import java.util.ArrayList;//导入 ArrayList 包 调用动态数组! public class ArrayListList { / ...

  6. jQuery 操作Cookie

    一个轻量级的cookie 插件,可以读取.写入.删除 cookie. 下载地址:http://plugins.jquery.com/cookie/ (在实际中可以用这个保存cookie保存用户的习惯, ...

  7. 只要访问url地址 那么容器就会根据地址进行对象的创建

    只要访问url地址 那么容器就会根据地址进行对象的创建

  8. 【转】微信小程序开发之图片等比例缩放 获取屏幕尺寸图片尺寸 自适应

    原文[https://blog.csdn.net/qq_31383345/article/details/53127804] 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于 ...

  9. BZOJ2176Strange string——最小表示法

    题目描述 给定一个字符串S = {S1, S2, S3 … Sn}, 如果在串SS中, 子串T(|T| = n)为所有长度为n的SS的字串中最小的(字符串的比较), 则称T为”奇怪的字串”. 你的任务 ...

  10. POJ1860-Currency Exchange-判正环

    两种货币的交换可以当成两条边,建图后跑Bellman_ford算法就好了. Bellman_ford算法可以用来处理负边权,所以可以判断是否存在负环.反过来就可以判断是否存在正环. /*------- ...