• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

使用宝塔面板安装Rocket.Chat多功能团队聊天室

建站知识 Liam 1年前 (2019-06-27) 765次浏览 21个评论 扫描二维码
文章目录[隐藏]

说明:Rocket.Chat一年前就介绍过→传送门,一款多功能团队聊天室,支持群组聊天,直接通信,私聊群,桌面通知,媒体嵌入,链接预览,文件上传,语音/视频,聊天,截图,实时翻译等等,安装方法比较简单的有SnapDocker,此前也只说过Snap安装方法,由于一直有小伙伴需要宝塔面板安装教程,所以这里就水一篇宝塔教程。

安装

官方文档:https://rocket.chat/docs/

环境要求:NodeJS 8.11.4Mongodb 4.0.9Nginx(非必需)。

提示:由于官方建议的最低内存1G,所以512M或更小的建议加点虚拟内存,可以使用Swap一键脚本→传送门

1、安装宝塔

#CentOS系统 wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh #Ubuntu系统 wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh #Debian系统 wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh 

安装完成后,进入面板,点击左侧软件商店,然后安装PM2管理器MongoDBNginx(使用域名访问才需要安装,反之不用)。

注意:Debian安装MongoDb之前还需要使用命令apt install sudo,不然可能存在MongoDb启动不了的情况;如果你已经安装了MongoDb,那就先使用apt install sudo,再使用/etc/init.d/mongodb start启动即可。

2、环境配置
先点击左侧软件商店,找到PM2管理器设置选项,选择Node版本,切换到8.11.4版本,不然太高可能会导致Rocket.Chat运行出错。

然后再找到MongoDb设置选项,点击配置文件,新增/修改以下代码:

#设置storage引擎,新增engine参数,并修改下dbPath路径,不然会启动不了 storage:   dbPath: /www/server/mongodb/data   directoryPerDB: true   engine: mmapv1   journal:     enabled: true #配置replica set,新增以下参数 replication:   replSetName: rs01 

保存后,MongoDb会自动关闭,这时候使用命令:

#新建数据存储路径,即上面配置文件修改的dbPath参数 mkdir /www/server/mongodb/Rocket.Chat #授权 chown mongo:mongo /www/server/mongodb/Rocket.Chat #重新启动数据库 /etc/init.d/mongodb start #启动replica set mongo --eval "printjson(rs.initiate())" 

3、安装依赖

#Debian/Ubuntu系统 apt install -y graphicsmagick #CentOS系统 yum install -y GraphicsMagick 

4、安装Rocket.Chat

#下载rocket.chat wget -O rocket.chat.tgz https://releases.rocket.chat/latest/download  #解压并删除 tar -xzf rocket.chat.tgz && rm -rf rocket.chat.tgz #移动到/opt并重命名 mv bundle /opt/Rocket.Chat #安装依赖 cd /opt/Rocket.Chat npm install -g inherits cd programs/server npm install 

5、启动Rocket.Chat

#新建rocketchat用户并授权 useradd -M rocketchat && usermod -L rocketchat chown -R rocketchat:rocketchat /opt/Rocket.Chat #新建systemd配置文件,将以下代码一起复制到SSH运行 cat > /etc/systemd/system/rocketchat.service <<EOF [Unit] Description=Rocket.Chat After=network.target Wants=network.target  [Service] ExecStart=$(command -v node) main.js StandardOutput=syslog StandardError=syslog SyslogIdentifier=rocketchat User=rocketchat WorkingDirectory=/opt/Rocket.Chat Environment=MONGO_URL=mongodb://127.0.0.1:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local?replicaSet=rs01 ROOT_URL=http://127.0.0.1:3000/ PORT=3000 Type=simple Restart=on-failure RestartSec=42s  [Install] WantedBy=multi-user.target EOF 

开始启动:

#启动的时候,可能需要点时间加载,等待即可 systemctl start rocketchat 

查看状态:

systemctl status rocketchat 

开机自启:

systemctl enable rocketchat 

此时访问地址为ip:3000,如果你想用ip访问,点击左侧安全,开放3000端口即可,如果想用域名访问,不需要开启,继续往下面看。

6、域名访问
要使用域名的话就需要进行反代了,这里就不用宝塔自带的反向代理配置了,默认配置不适合Rocket.Chat

先点击左侧网站,添加站点,然后再点击添加好了的域名名称,这时候就进入了站点配置,点击配置文件,在中间添加以下代码:

location ~ ^/.* {     proxy_pass http://127.0.0.1:3000;     proxy_set_header Host             $host;     proxy_set_header X-Real-IP        $remote_addr;     proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;      proxy_set_header Upgrade $http_upgrade;     proxy_set_header Connection "upgrade";     proxy_set_header X-Forward-Proto http;     proxy_set_header X-Nginx-Proxy true;     proxy_http_version 1.1;      proxy_redirect off; } 

点击保存后,再点击SSL,申请免费的Let's Encrypt证书,并强制HTTPS

配置好了后就可以使用域名访问了,然后根据要求安装好,最后就可以进入你的Rocket.Chat聊天室了,还有更多使用方法可以直接查看→传送门


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:使用宝塔面板安装Rocket.Chat多功能团队聊天室
喜欢 (2)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(21)个小伙伴在吐槽
  1. Hello There. I found your blog the use of msn. That is a really smartly written article. I'll be sure to bookmark it and return to learn more of your helpful info. Thank you for the post. I will definitely comeback.
    cheap flights2020-08-28 04:45 回复 Linux | Firefox浏览器 4E2F
  2. I am regular reader, how are you everybody? This post posted at this web page is in fact nice.
    cheap flights2020-08-27 12:00 回复 Mac OS X | Chrome 66.0.3359.117
  3. My programmer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the costs. But he's tryiong none the less. I've been using Movable-type on various websites for about a year and am worried about switching to another platform. I have heard very good things about blogengine.net. Is there a way I can transfer all my wordpress posts into it? Any kind of help would be really appreciated! 3aN8IMa cheap flights
    cheap flights2020-08-26 18:23 回复 Linux | Firefox浏览器 4E2F
  4. Hey! I know this is somewhat off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having problems finding one? Thanks a lot! cheap flights 3aN8IMa
    cheap flights2020-08-25 09:53 回复 Linux | Chrome 51.0.2705.45
  5. Awesome post.
    web hosting company2020-08-14 14:09 回复 Mac OS X | Chrome 66.0.3359.181
  6. fantastic publish, very informative. I wonder why the other specialists of this sector don't realize this. You should continue your writing. I am confident, you have a great readers' base already!
    web hosting reviews2020-08-11 07:34 回复 Linux | Firefox浏览器 60.0.2
  7. I was suggested this website by my cousin. I'm not sure whether this post is written by him as no one else know such detailed about my difficulty. You're wonderful! Thanks!
    best hosting2020-08-11 05:27 回复 Linux | Chrome 66.0.3359.139
  8. After I originally commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on each time a comment is added I get four emails with the exact same comment. Perhaps there is a way you are able to remove me from that service? Kudos!
    web hosting reviews2020-08-07 22:10 回复 Linux | Chrome 67.0.3372.0
  9. Hey! Do you know if they make any plugins to assist with Search Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Kudos!
    web hosting reviews2020-08-05 22:52 回复 Linux | Firefox浏览器 52.9
  10. It's a shame you don't have a donate button! I'd most certainly donate to this brilliant blog! I suppose for now i'll settle for bookmarking and adding your RSS feed to my Google account. I look forward to brand new updates and will share this site with my Facebook group. Chat soon!
    flight ticket booking2020-07-31 11:16 回复 Linux | Firefox浏览器 54.0
  11. It's hard to find educated people in this particular subject, however, you sound like you know what you're talking about! Thanks adreamoftrains website host
    adreamoftrains website hosting companies2020-07-30 17:27 回复 Linux | Chrome 66.0.3359.181
  12. Good day! This post could not be written any better! Reading this post reminds me of my good old room mate! He always kept chatting about this. I will forward this page to him. Pretty sure he will have a good read. Many thanks for sharing!
    cheapest2020-07-29 12:38 回复 Linux | Chrome 66.0.3359.181
  13. Attractive section of content. I just stumbled upon your website and in accession capital to assert that I get actually enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently quickly.
    cheap flights with jet2 holidays2020-07-28 07:57 回复 Linux | Chrome 66.0.3359.106
  14. Good post. I learn something new and challenging on websites I stumbleupon on a daily basis. It's always useful to read through articles from other writers and use a little something from their web sites.
    airline flights2020-07-27 22:32 回复 Windows 7 | Internet Explorer 10.0
  15. I have been exploring for a little bit for any high quality articles or blog posts on this sort of space . Exploring in Yahoo I at last stumbled upon this site. Studying this information So i am satisfied to exhibit that I've an incredibly excellent uncanny feeling I came upon exactly what I needed. I most certainly will make certain to do not forget this web site and provides it a glance regularly.
    web host2020-07-26 04:09 回复 Linux | Chrome 56.0.2924.87
  16. Wow that was odd. I just wrote an very long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say fantastic blog!
    best web hosting sites2020-07-18 06:09 回复 Linux | Firefox浏览器 60.0.2
  17. I do not know if it's just me or if perhaps everyone else experiencing issues with your blog. It looks like some of the text within your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too? This may be a issue with my browser because I've had this happen before. Thanks
    hosting services2020-07-16 19:47 回复 Linux | Firefox浏览器 2.0.0.6
  18. Howdy, I believe your site could possibly be having browser compatibility problems. Whenever I take a look at your website in Safari, it looks fine however when opening in I.E., it's got some overlapping issues. I merely wanted to give you a quick heads up! Aside from that, fantastic blog!
    cbd oil that works 20202020-06-28 09:30 回复 Linux | Chrome 67.0.3396.0
  19. This post is invaluable. Where can I find out more?
    ww2.telechat.info2020-06-27 11:27 回复 Linux | Chrome 66.0.3359.117
  20. Hi there! I could have sworn I've been to this website before but after reading through some of the post I realized it's new to me. Anyways, I'm definitely glad I found it and I'll be book-marking and checking back frequently!
    asaadogawa.com2020-06-26 09:56 回复 Windows 8.1 | Firefox浏览器 60.0
  21. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to read?
    rsacwgxy g2020-06-22 17:20 回复 Linux | Chrome 59.0.3071.86