Getting real time updates in StatusNet

Tonight I installed Meteor on my server to allow my StatusNet site to update pages automatically as the updates come in. This is enabled via the Realtime plugin.

To enable the realtime module you will need:

  • A firewall running on your web server (or in front of it)
  • A copy of Meteor on the server
  • Start / stop script for meteor if you are not running Fedora
  • Firewall customization - port mapping
  • A domain name for the server which is visible externally

Installing Meteor

Consider following Meteor's installation guide

  • Create a folder called /usr/local/meteor
  • Download the Meteor source code
  • Untar the file in your /usr/local/meteor directory (yes, it will drop files everywhere, sigh!)
  • Add a non-root user for it to run: useradd meteor
  • Copy over the configuration file: cp meteord.conf.dist /etc/meteord.conf
  • Run meteor: cd /usr/local/meteor && ./meteord -d did it run? (control-C to close it after testing)
  • Test the listener port: telnet localhost 4670
  • Test the command port: telnet localhost 4671
  • The installation guide recommends you create a startup script (cp daemoncontroller.dist /etc/init.d/meteord), however it only works on Fedora. Below is the "Debian version" I created.
  • Be sure to /etc/init.d/meteor stop your test run once your startup script is installed so you can /etc/init.d/meteor start it with the right permissions.
  • Repeat the telnet tests once you are live with your firewall settings.

Debian Startup Script

This is what I'm using in place of the file the meteor creators recommend for /etc/init.d/meteor. This one will run in Debian.

# description: Runs meteord
# chkconfig: 2345 99 00

# Source function library.
#. /etc/init.d/functions

case "$1" in
echo -n "Starting Meteord: "
#echo 65535 > /proc/sys/fs/file-max
ulimit -n 65535
cd /usr/local/meteor
su meteor -c ./meteord >/var/log/meteord 2>&1 &
echo -n "Stopping Meteord: "
killall meteord && success || failure
echo -n "Reloading Meteord configuration: "
killall -s SIGHUP meteord && success || failure
echo "Usage: $0 { start | stop | reload }"
exit 0

Firewall settings

  • Block all external connections on port 4671
  • Map an unused external port (such as 81) to port 4670

Update your config file

The last step is to add the configuration to your StatusNet config.php file.

addPlugin('Meteor', array(
'webserver' => '',
'webport' => '81',
'controlserver' => '',
'controlport' => '4671'

This detail actually comes from the StatusNet site.

That's it! If realtime is enabled correctly you will see a play/pause button at the top of your feed and a link to a pop-up window you can use to monitor the internets all day long.

If your updates aren't working go back and check that the external world can access the port you have assigned for reading from meteor (in my example I had to ensure 81 was mapped to 4670 correctly). I had to try a couple times to get it right.

Enjoy getting real time updates!