centos7下部署rocketchat软件
来源:互联网 发布:js定义一个json对象 编辑:程序博客网 时间:2024/06/04 22:10
在使用 RocketChat 之前,公司内部一直使用微信和 QQ 进行沟通和交流,安全性,开放性,易用性都不足。 RocketChat 的出现,提供了 Slack 的基础功能、开放的 API、与 GitLab 的良好集成,我们可以自己部署,作为内部聊天软件,保证公司业务安全性与易用性。
1.添加epel扩展源。
rpm -Uvh http://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
2.安装mongdb
vim /etc/yum.repos.d/mongodb-org.repo[mongodb-org-3.4]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
yum -y install mongodb-orgsystemctl start mongodsystemctl enable mongod
3.安装node.js
wget https://nodejs.org/dist/v0.10.40/node-v0.10.40-linux-x64.tar.gzsudo tar -C /usr/local --strip-components 1 -zxvf node-v0.10.40-linux-x64.tar.gzyum -y install nodejs npmnpm install -g inherits nn 4.5yum -y install curl GraphicsMagick gcc-c++
4.安装rocketchat
cd /optcurl -L https://rocket.chat/releases/latest/download -o rocket.chat.tgztar zxvf rocket.chat.tgzmv bundle Rocket.Chatcd Rocket.Chat/programs/server npm installcd /opt/Rocket.Chatexport ROOT_URL=https://your-domain.com/export MONGO_URL=mongodb://localhost:27017/rocketchatexport PORT=3000node main.js(需要什么可以通过 npm install ***)
5.配置开机自启动
[Unit]Description=The Rocket.Chat serverAfter=network.target remote-fs.target nss-lookup.target mongod.target[Service]Type=simpleExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.jsRestart=alwaysStandardOutput=syslogStandardError=syslogSyslogIdentifier=rocketchatUser=rootEnvironment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=http://yourdomain.com PORT=3000[Install] WantedBy=multi-user.target
systemctl start rocketchatsystemctl enable rocketchat
(6)音、视频服务强制要求 SSL。推荐 Lets Encrypt 免费证书配合http或者Nginx实现HTTPS访问·。
a apache与let’s encrypt
yum -y install httpd mod_sslsystemctl start httpdsystemctl enable httpd
vim /etc/httpd/conf.d/yourdomain.com.conf<VirtualHost *:80>ServerName chat.owfox.comRedirect permanent / https://chat.owfox.com/TransferLog /var/log/httpd/chat.owfox.com_access.logErrorLog /var/log/httpd/chat.owfox.com_error.log</VirtualHost><VirtualHost *:443>ServerName chat.owfox.comServerAdmin me@liptanbiswas.comSSLEngine OnSSLCertificateFile /etc/letsencrypt/live/chat.owfox.com/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/chat.owfox.com/privkey.pemProxyPreserveHost OnProxyPassMatch ^/sockjs/(.*)/websocket ws://192.168.16.8:3000/sockjs/$1/websocketProxyPass / http://192.168.16.8:3000/ProxyPassReverse / http://192.168.16.8:3000/TransferLog /var/log/httpd/chat.owfox.com_ssl_access.logErrorLog /var/log/httpd/chat.owfox.com_ssl_error.log</VirtualHost>
systemctl restart httpd
使用浏览器或者客户端通过https://yourdomain.com访问
B Nginx与let’s encrypt
yum install nginx
vim /etc/nginx/nginx.conf#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream chat { server 192.168.16.8:3000; } server { listen 80 default; server_name chat.owfox.com; rewrite ^ https://$server_name$request_uri? permanent; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # server { listen 443 ssl; server_name chat.owfox.com; ssl_certificate /etc/letsencrypt/live/chat.owfox.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/chat.owfox.com/privkey.pem; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; location / { proxy_pass http://chat; proxy_set_header Host $http_host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }
阅读全文
1 0
- centos7下部署rocketchat软件
- CentOS7下部署tomcat
- CentOs7下部署tomcat文件服务器
- 在centOS7下部署tpshop
- Centos7下nodejs-mongodb部署
- CentOS7.0下完美部署Solr 搜索引擎
- CentOS7下hadoop2.6.0分布式部署
- centos7 下用docker部署nodejs应用
- centos7环境下ceph安装部署
- Centos7下Hive-1.2.1安装部署
- CentOs7下redis的部署和安装
- 在Centos7下安装部署Zabbix3.2
- centOS7下部署tomcat后对外开放端口
- CentOS7下TestLink环境的部署
- Centos7下Flask+uwsgi+Nginx部署实践
- centos7下SVN搭建部署全过程
- CENTOS7下部署数据库与应用
- CentOS7下部署CDH5.9(HA)
- Power Designer 添加MySQL数据源
- Python基础篇之Socket编程 SocketServer
- HDU 3625 Examining the Rooms(第一类stirling数)
- 第八章 –– 常见类大数据BigInteger和BigDecimal
- 超分辨率重建之FSRCNN
- centos7下部署rocketchat软件
- winform菜单
- 1237:最左边的一位数
- 理解Linux系统/etc/init.d目录和/etc/rc.local脚本
- java中getAttribute和getParameter的区别
- Android进程间通信(IPC)机制Binder简要介绍和学习计划
- CSU-ACM2017暑假集训比赛7 A
- 【React Native开发】React Native控件之Touchable*系列组件详解(18)
- excel的导出和下载