【发布时间】:2018-09-02 15:56:19
【问题描述】:
如何应用 node.js 安全补丁? 在 ubuntu 16.04 上使用流星 js 时是否有特定的流程来应用安全补丁?
【问题讨论】:
-
欢迎来到 Stack Overflow。我可以建议你把这个问题放在askubuntu.com 上吗?那里的贡献者可能有很好的答案。
标签: node.js security meteor patch
如何应用 node.js 安全补丁? 在 ubuntu 16.04 上使用流星 js 时是否有特定的流程来应用安全补丁?
【问题讨论】:
标签: node.js security meteor patch
当您在生产模式下运行流星时,它作为(纯)node.js 应用程序运行。因此,对您的问题的简短回答是仅更新节点(取决于您如何安装它;可能是sudo apt-get update -y && sudo apt-get install nodejs -y)。
您可以使用多种工具来部署流星应用程序(例如meteor-up),但它们都具有基本相同的两个步骤,您自己很容易做到:
将您的流星应用程序捆绑到 node.js 应用程序中
meteor build ../my-build-output-folder --server https://my.production.site.url --architecture os.linux.x86_64
这将在您指定的文件夹中创建一个 meteor-server.tar.gz 文件,其中包含 node.js 应用程序。然后该过程(根据捆绑包中包含的README 文件):
meteor-server.tar.gz 文件传输到您的服务器tar -zxvf meteor-server.tar.gz提取节点应用README 文件告诉您其余的:自述文件:
This is a Meteor application bundle. It has only one external dependency:
Node.js v8.11.4. To run the application:
$ (cd programs/server && npm install)
$ export MONGO_URL='mongodb://user:password@host:port/databasename'
$ export ROOT_URL='http://example.com'
$ export MAIL_URL='smtp://user:password@mailhost:port/'
$ node main.js
Use the PORT environment variable to set the port where the
application will listen. The default is 80, but that will require
root on most systems.
upstart、pm2、supervisord 或 docker
【讨论】: