Step to setup a Meteor Server on Linux

Node.js

Node is our javascript server

#install EPEL repo if you don't have it already
yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Install Node.js
sudo yum install nodejs npm --enablerepo=epel

Forever

Forever will start our server and make sure it keeps running.

sudo npm install -g forever




MongoDB

Mongo will be our database server

su
echo [mongodb] > /etc/yum.repos.d/mongodb.repo
echo name=MongoDB Repository >> /etc/yum.repos.d/mongodb.repo
echo baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ >> /etc/yum.repos.d/mongodb.repo
echo gpgcheck=0 >> /etc/yum.repos.d/mongodb.repo
echo enabled=1 >> /etc/yum.repos.d/mongodb.repo
yum update -y
yum install mongodb-org
service mongod start
chkconfig mongod on

Meteor

curl install.meteor.com | /bin/sh

Create Git Repo on Server

mkdir example.git
cd example.git
git --bare init
cd ..

Add repo to local Git project

git remote add origin ssh://user@00.00.00.00/~/example.git
git push origin master

Clone the project on the server

git clone example.git

Setup bundler

echo cd example > bundle.sh
echo git pull >> bundle.sh
echo meteor bundle ../bundle.tgz >> bundle.sh
echo cd .. >> bundle.sh
echo sudo forever stop bundle/main.js >> bundle.sh
echo tar -zxvf bundle.tgz >> bundle.sh
echo PORT=80 MONGO_URL=mongodb://localhost:27017/example ROOT_URL=http://localhost forever start bundle/main.js >> bundle.sh
chmod +x ./bundle.sh

Start it up!

./bundle.sh

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *