DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Deploy Meteor Application Manually


首先在阿里云上购买一台"云服务器ECS", 然后进入通过SSH连接VPS。

作为Meteor应用的生产环境,只需要安装mongoDB和Node.js就可以了,不需要安装Meteor. 通过aptitude安装的mongoDB虽然版本比较老(2.4),但不接受本机以外的连接, 安全性有保障。

# aptitude update
# aptitude install mongodb-server
# aptitude install software-properties-common
# add-apt-repository ppa:chris-lea/node.js
# aptitude update
# aptitude install nodejs

Then create a start script "startMeteor":

1
2
3
4
5
6
#!/bin/bash

export PORT=80
export MONGO_URL=mongodb://localhost:27017/newfairs
export ROOT_URL=http://www.newfairs.biz
node /root/bundle/main.js > /root/meteorApp.log

Now build Meteor application package on developing computer, and transfer it to production machine:

cd /path/to/meteorProjectRoot
meteor build .
scp newfairsweb.tar.gz alivps:~/

On production machine, extract Meteor package and install it as a node app:

cd /root
tar zxf newfairsweb.tar.gz
cd bundle/programs/server
npm install

将VPS恢复到初始状态的方法是:在云服务器ECS主页的"实例"页下, 对应主机最右边,"管理 升级 续费 更多"中点击"更多", 首先点击"停止"来停止实例运行,然后点击"重新初始化磁盘", 将系统盘和数据盘都初始化。



Published

Mar 26, 2015

Last Updated

Mar 26, 2015

Category

Tech

Tags

  • aliyun 2
  • deploy 1
  • meteor 47

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor