{"id":45286,"date":"2024-10-06T21:47:13","date_gmt":"2024-10-06T13:47:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45286\/"},"modified":"2024-10-06T21:47:13","modified_gmt":"2024-10-06T13:47:13","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-7-%e4%b8%8a%e9%83%a8%e7%bd%b2-rocket-chat","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45286\/","title":{"rendered":"\u5982\u4f55\u5728 CentOS 7 \u4e0a\u90e8\u7f72 Rocket.Chat"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-7-%e4%b8%8a%e9%83%a8%e7%bd%b2-rocket-chat-kVbkjOrgIS\">\u5982\u4f55\u5728 CentOS 7 \u4e0a\u90e8\u7f72 Rocket.Chat<\/h1>\n<p>Rocket.Chat \u662f\u4e00\u6b3e\u958b\u6e90\u7684\u5373\u6642\u901a\u8a0a\u5e73\u53f0\uff0c\u9069\u5408\u5718\u968a\u5354\u4f5c\u548c\u793e\u4ea4\u4e92\u52d5\u3002\u5b83\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u529f\u80fd\uff0c\u5305\u62ec\u8996\u983b\u901a\u8a71\u3001\u6587\u4ef6\u5171\u4eab\u548c\u591a\u7a2e\u96c6\u6210\u9078\u9805\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 CentOS 7 \u4e0a\u90e8\u7f72 Rocket.Chat\uff0c\u8b93\u60a8\u80fd\u5920\u8f15\u9b06\u8a2d\u7f6e\u81ea\u5df1\u7684\u901a\u8a0a\u5e73\u53f0\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%8f%90%e6%a2%9d%e4%bb%b6-kVbkjOrgIS\">\u524d\u63d0\u689d\u4ef6<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684 CentOS 7 \u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86\u4ee5\u4e0b\u7d44\u4ef6\uff1a<\/p>\n<ul>\n<li>Node.js\uff08\u7248\u672c 12 \u6216\u66f4\u9ad8\uff09<\/li>\n<li>MongoDB\uff08\u7248\u672c 4.0 \u6216\u66f4\u9ad8\uff09<\/li>\n<li>npm\uff08Node.js \u7684\u5305\u7ba1\u7406\u5668\uff09<\/li>\n<li>Git<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d-node-js-%e5%92%8c-npm-kVbkjOrgIS\">\u5b89\u88dd Node.js \u548c npm<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd Node.js \u548c npm\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd\uff1a<\/p>\n<pre><code>curl -sL https:\/\/rpm.nodesource.com\/setup_12.x | bash -\nyum install -y nodejs<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7248\u672c\uff1a<\/p>\n<pre><code>node -v\nnpm -v<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-mongodb-kVbkjOrgIS\">\u5b89\u88dd MongoDB<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88dd MongoDB\u3002\u9996\u5148\uff0c\u6dfb\u52a0 MongoDB \u7684\u5b98\u65b9\u5eab\uff1a<\/p>\n<pre><code>cat &gt; \/etc\/yum.repos.d\/mongodb-org-4.0.repo &lt;&lt;EOF\n[mongodb-org-4.0]\nname=MongoDB Repository\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/7\/mongodb-org\/4.0\/x86_64\/\ngpgcheck=1\nenabled=1\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-4.0.asc\nEOF<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u5b89\u88dd MongoDB\uff1a<\/p>\n<pre><code>yum install -y mongodb-org<\/code><\/pre>\n<p>\u555f\u52d5 MongoDB \u4e26\u8a2d\u7f6e\u70ba\u958b\u6a5f\u81ea\u555f\uff1a<\/p>\n<pre><code>systemctl start mongod\nsystemctl enable mongod<\/code><\/pre>\n<h2 id=\"%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-rocket-chat-kVbkjOrgIS\">\u4e0b\u8f09\u548c\u5b89\u88dd Rocket.Chat<\/h2>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u4e0b\u8f09 Rocket.Chat \u7684\u6700\u65b0\u7248\u672c\u3002\u4f7f\u7528 Git \u514b\u9686\u5b98\u65b9\u5009\u5eab\uff1a<\/p>\n<pre><code>git clone -b HEAD https:\/\/github.com\/RocketChat\/Rocket.Chat.git<\/code><\/pre>\n<p>\u9032\u5165\u4e0b\u8f09\u7684\u76ee\u9304\uff1a<\/p>\n<pre><code>cd Rocket.Chat<\/code><\/pre>\n<p>\u5b89\u88dd\u6240\u9700\u7684 npm \u4f9d\u8cf4\uff1a<\/p>\n<pre><code>npm install<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-rocket-chat-kVbkjOrgIS\">\u914d\u7f6e Rocket.Chat<\/h2>\n<p>\u5728\u555f\u52d5 Rocket.Chat \u4e4b\u524d\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e\u74b0\u5883\u8b8a\u91cf\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u8a2d\u7f6e\uff1a<\/p>\n<pre><code>export ROOT_URL=http:\/\/your_domain_or_IP:3000\nexport MONGO_URL=mongodb:\/\/localhost:27017\/rocketchat\nexport PORT=3000<\/code><\/pre>\n<p>\u8acb\u5c07 <code>your_domain_or_IP<\/code> \u66ff\u63db\u70ba\u60a8\u7684\u57df\u540d\u6216 IP \u5730\u5740\u3002<\/p>\n<h2 id=\"%e5%95%9f%e5%8b%95-rocket-chat-kVbkjOrgIS\">\u555f\u52d5 Rocket.Chat<\/h2>\n<p>\u6700\u5f8c\uff0c\u60a8\u53ef\u4ee5\u555f\u52d5 Rocket.Chat\uff1a<\/p>\n<pre><code>npm start<\/code><\/pre>\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f <code>http:\/\/your_domain_or_IP:3000<\/code> \u4f86\u4f7f\u7528 Rocket.Chat\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-kVbkjOrgIS\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u5728 CentOS 7 \u4e0a\u90e8\u7f72 Rocket.Chat\u3002\u9019\u500b\u904e\u7a0b\u5305\u62ec\u5b89\u88dd Node.js\u3001MongoDB\u3001\u4e0b\u8f09 Rocket.Chat \u4ee5\u53ca\u914d\u7f6e\u548c\u555f\u52d5\u670d\u52d9\u3002\u900f\u904e\u9019\u4e9b\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u8a2d\u7f6e\u81ea\u5df1\u7684\u5373\u6642\u901a\u8a0a\u5e73\u53f0\uff0c\u4fc3\u9032\u5718\u968a\u5354\u4f5c\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u4f86\u904b\u884c\u60a8\u7684 Rocket.Chat\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u9069\u5408\u4e0d\u540c\u9700\u6c42\u7684\u7528\u6236\u3002\u7121\u8ad6\u662f <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u9084\u662f\u5176\u4ed6\u5730\u5340\u7684 <a href=\"https:\/\/server.hk\">\u4e91\u670d\u52a1\u5668<\/a>\uff0c\u6211\u5011\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u53ef\u9760\u7684\u670d\u52d9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u5982\u4f55\u5728 CentOS 7 \u4e0a\u5feb\u901f\u90e8\u7f72 Rocket.Chat\uff0c\u63d0\u4f9b\u5b9e\u65f6\u804a\u5929\u89e3\u51b3\u65b9\u6848\uff0c\u63d0\u5347\u56e2\u961f\u6c9f\u901a\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45286","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45286"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45286\/revisions"}],"predecessor-version":[{"id":45287,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45286\/revisions\/45287"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}