在 Windows 上部署 Meteor [英] Deploy Meteor on Windows

查看:68
本文介绍了在 Windows 上部署 Meteor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得很奇怪,没有关于如何将您自己的 Meteor webapp 部署到您自己的 Windows 服务器上的详细分步说明.也许我只是无法使用 Google 找到这样的解释.

I find it rather weird that there are no detailed step by step explanations on how to deploy your own Meteor webapp onto your own Windows server. Or maybe I'm just not able to use Google to find one such explanation.

在许多页面上,甚至在 SO 上的一些问题上,我发现人们只是说像任何其他 node.js 应用程序一样构建和部署它",这很棒,但我不能查找有关如何将 node.js webapp 部署到 Windows 服务器的任何说明.

On many pages, even on some questions here on SO, I found people simply saying "build it and deploy it like any other node.js app" which is great, except I can't find any explanation on how to deploy a node.js webapp on to a Windows server either.

Meteor 太棒了,我觉得如果有人能一步一步地写出如何在 Windows 服务器上部署 Meteor 应用程序,那么很多人都会非常高兴的露营者... 特别是如果说明描述了如何将多个 Meteor 应用程序部署到一台 Windows 服务器上 ;)

Meteor is so awesome, that I feel if anyone would write up such a step by step on how to deploy a Meteor app on a Windows server, a looooot of people would be very happy campers... Especially if the explaintion describes how to deploy multiple Meteor apps onto one Windows server ;)

它当然不必是 IIS,nginx 在 Windows 上运行很好.

It certainly does not have to be IIS, nginx runs on Windows just fine.

此外,Node.js 在 Windows 上运行就好了.MongoDB 在 Windows 上运行就好了,作为一项服务.Meteor 在 Windows 上构建应用程序显然很好.因此,将其部署在 Windows 服务器上确实只缺少最后一步......

Also, Node.js runs on Windows just fine. MongoDB runs on Windows just fine, as a service. Meteor builds the apps on Windows apparently just fine. So, it really is missing just one last step to get it deployed on a Windows server as well...

那么,有谁知道如何在一台 Windows 服务器上部署多个 Meteor 应用程序,并且愿意为此编写n00b 友好的分步说明?

So, anyone out there knows how to deploy several Meteor apps on one Windows server and is willing to write up a n00b-friendly step by step explanation for that?

好吗?

推荐答案

Predrag -- 我开始在 Meteor 论坛上写下我希望能成为相当合理的分步指南的内容:Windows 部署.

Predrag -- I started to write up what I hope is going to be a fairly reasonable step-by-step guide on the Meteor Forums here: Windows Deployment.

希望在接下来的几天里我能完成它,但这只是一个开始!

Hopefully over the next few days I'll complete it, but it's a start!

同时,对于不需要分步指南的人来说,这里是基本步骤:

Meanwhile here are the basic steps for those who don't need a step-by-step guide:

  • 在某些 Windows 机器上(如果您在 Windows 上开发,当然可以是您的开发机器)确保安装以下内容:

  • On some Windows machine (can certainly be your development machine if you are developing on Windows) make sure to have the following installed:

  1. 流星
  2. 安装了 C++ 命令行构建工具的 VS12(VS15 可能可以工作,但我使用的是 VS12)!
  3. 节点(如果你很棘手,可以是嵌入在 Meteor 中的相同节点)否则任何节点都应该工作
  4. npm
  5. demeteorizer (npm install -g demeteorizer)

  • 然后从您的 Meteor 项目运行以下命令:

  • Then from your Meteor project run the following:

    demeteorizer -o c:\somepath
    cd c:\somepath\bundle\programs\server
    npm install
    

  • 这是关键部分.最后一个命令将尝试构建 Fibers .. 所以请确保可以找到 VS 命令行工具并使其工作.

    This is the critical part. The last command will attempt to build Fibers .. so make sure the VS command line tools can be found and work.

    如果上述方法有效,您就快到家了!

    If the above works, you are almost home!

    运行要运行应用程序——它与任何其他节点应用程序非常相似,除了我们需要(至少)定义两个环境变量(下面的前两个).我通过 .bat 文件执行此操作,但任何等效文件都应该可以工作.ENV 变量在 BTW 上面的 bundle 目录下的 README 文件中定义,如果你想阅读它们.

    Running To run the application -- it IS very similar to any other node application except we need to define (at a minimum) two environment variables (the first two below). I do this via a .bat file, but whatever equivalent should be able to work. The ENV variables are defined in the README file under the bundle directory above BTW if you want to read about them.

    set MONGO_URL=mongodb://localhost:27017/mydbname
    set ROOT_URL=http://myapp.example.com:8080
    set PORT=8080
    set MAIL_URL=smtp://user:password@host:port
    node main.js
    

    现在上面假设了许多简单的事情,即您在本地机器上运行您的 MongoDB,没有用户安全性,在默认端口.如果没有,您需要更改 MONGO_URL 部分以反映现实.mydbname"是您想要调用文档集合的任何逻辑名称.在开发模式下,这是流星",但在生产中不太可能有意义(特别是如果它针对真正的生产数据库!).这也假设没有 Oplog Tailing.

    Now the above assumes many simplistic things, namely that your are running your MongoDB on the local machine, with no user security, at the default port. If not, you'll need to change the MONGO_URL part to reflect reality. The "mydbname" is whatever logical name you want to call your collection of documents. In Development mode this was "meteor" but it's unlikely that makes much sense in production (especially if it's against a real production DB!). This also assumes NO Oplog Tailing.

    我喜欢在 .bat 文件中明确指定 PORT,所以很清楚,当然需要这样做,除非您想使用 3000(或 80 - 无论默认值是多少,我不记得了).

    I like to specify the PORT explicitly in the .bat file so it's clear and of course needs to be done unless you want to use 3000 (or 80 - whatever the default is, which I don't remember).

    如果您使用任何执行电子邮件通知等的用户包,您可能还需要设置 MAIL_URL.我把它放在上面,但它是可选的.

    You may also have to set the MAIL_URL if you are using any of the user packages that does email notification, etc. I put it above but it's optional.

    无论如何,这是基础.有关更多详细信息,请阅读上面链接的指南(正在进行中).

    Anyway, that's the basics. For more details please read the guide linked above (which is a work in progress).

    这篇关于在 Windows 上部署 Meteor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆