Installing and running Orbited and Status.net on an Ubuntu server
Orbited is a Python-based server that allows us to push data from the server to the browser without the browser explicitly requesting it. This means we can push live updates to users on our status.net instance as they happen.
I'm going to be setting up the Orbited server on the same machine as the status.net install, and using SSL to secure the connection for both the standard site and the orbited pushed updates. This means we're going to make some minor edits to the status.net and Orbited source code to facilitate this. There are other ways of doing this, but I found this to be the simplest.
I'll assume you've already got a working status.net install before we begin. If not, see the installation instructions on their site.
Next, we need to install python twisted, orbited and stomp:
Next we need to change some settings in the Orbited configuration file:
Linux is more efficient using epoll, so change
We want Orbited to run as an unprevileged user (which will be called 'orbited'), so change
Make sure Orbited will be listening on the following ports:
We don't need to activate the SSL port because apache will be listening on that port and passing requests to Orbited on the same machine.
Now change the access section to allow connections to Orbited. Make sure you replace "example.com" with your domain.
This allows everything (*) to connect to the local machine on port 61613. Really, we only need the local machine to be able to access those ports (as we will be using Apache to proxy requests to and from them). You can lock this down once everything is running properly.
We're done editing the config, so press ctrl + x to exit and save your changes.
Next, we need to add a system user for Orbited to run as:
Now we can test the orbited server:
If you don't see any errors, press ctrl + c to kill the server.
Now we can edit our Apache virtualhost configuration to proxy requests for orbited. First, ensure the correct Apache modules are loaded:
Edit your site config:
and add the following:
Remember, this assumes you already have your SSL certificates set up and working. You can now restart Apache for the changes to take effect.
We will now edit our status.net install to use the Orbited server. First make sure status.net will load the Orbited plugin by editing the main configuration file:
add at the bottom of the file:
Now we will edit plugins/Orbited/OrbitedPlugin.php to ensure it uses SSL and our orbited path. Change:
and make sure the returned path is correct:
Press ctrl + x to exit and save, then edit Orbited.js to use our new Orbited path:
Exit and save again (ctrl + x). Create pid directory and make sure the orbited user owns it:
Now we can create an init.d script which we can use to start and stop our Orbited server:
then paste the following into the file and save.
Save the script (ctrl + x) and make it executable:
You should now be able to start and stop Orbited with
To make orbited start when the machine boots:
And you're done. You should now be able to log in to your status.net site and receive live updates pushed to your browser.