Installing Meteor Server on Ubuntu

Meteor is a javascript server that does interesting things like live updating your live blog with far less load on your server than without it. However, setting it up is iffy, and the instructions are not idiot proof. So here are the steps distilled from my hits and misses, so that you may not have to go through that yourself.

Meteor Server Installation instructions

These instructions are as per instructions provided on the Meteor Server website along with my comments.

Make a directory for the Meteor Server and cd into it.
mkdir usr/local/meteor
cd usr/local/meteor

We begin with getting and unpacking Meteor Server:
wget http://meteorserver.org/download/latest.tgz
tar zxvf latest.tgz
rm latest.tgz

Alas, this doesn’t work. There is no file at the provided url, and I had to use the url provided for download. So this should work.

wget https://github.com/visitsb/meteorserver/blob/master/build/meteor-latest.tgz?raw=true
At this point, check the name of the file you got.
ls
if it is “meteor-latest.tgz?raw=true”, then
mv meteor-latest.tgz?raw=true meteor-latest.tgz
before proceeding, or the next step won’t work. Now
ls
should give you “meteor-latest.tgz”. Ready to move on.
tar zxvf meteor-latest.tgz
rm meteor-latest.tgz

Now to set it up.

Copy the init script to /etc/init.d/meteord:

cp daemoncontroller.dist /etc/init.d/meteord

You will need to edit the file to change the path if you did not install meteor in /usr/local/meteor. If you wish to use this to start/stop Meteor, you will need to edit line 14 to specify which user account will be used to run it. The default is meteor, so if you want to create that user account now, type:

useradd meteor

Now copy the configuration file to /etc/meteord.conf:

cp meteord.conf.dist /etc/meteord.conf

To start meteor at boot, they recommend

chkconfig meteord on

This part didn't work for me, as I don't have chkconfig installed - the instructions seem "Fedora-ish" - I have no idea how Fedora works. Never used it. Instead, I did

update-rc.d meteord defaults
update-rc.d meteord enable

At this stage, you should be able to start meteor in debug mode (according to them).

./meteor -d

For me, it didn't. I needed to

chmod +x meteord

as they have suggested. I also did

chmod /etc/init.d/meteord

I could start meteor in debug mode successfully, but

/etc/init.d/meteord start

wouldn't work.

I was getting "/bin/sh^M: bad interpreter: No such file or directory"

Found two problems. The first was that /etc/init.d/meteord script refers to /etc/init.d/functions which didn't exist. I edited the file to change the line

. /etc/init.d/functions

to

. /lib/lsb/init-functions

By checking what file was being referred by scripts that were working.

About the "^M" in the error, I discovered that it was caused by the file having dos line endings. It should have been unix line endings.

I opened it in vi

vi /etc/init.d/meteord

and in the command mode itself (hit ESC if you've switched to INSERT) entered:

:set fileformat=unix

Then saved and exited

:wq

Now

/etc/init.d/meteord

starts Meteor.

:)

I will do a separate post on using Meteor to power Live Blogging Plus (when I finish doing it).

4 thoughts on “Installing Meteor Server on Ubuntu

  1. marxistvegan

    for emacs users open the /etc/init.d/meteord file the C – x RET f — then type unix C – x C – s
    that solved my problem in debian

    Reply

Leave a Reply

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