Note: Click on thumbnails for a larger/readable image.
Dave Winer is brilliant guy who made RSS a standard, "bootstrapped the blogging revolution" and invented a ton of incredibly elegant and useful tools. If you're not reading his blog you're seriously missing out.
One of the many interesting ideas he developed was the "river of news". A "river of news" is different from standard news readers and provides a much better user experience (don't take my word for it, go read about it yourself). Dave recently shipped River 5, the latest implementation of the "river of news".
There are some very good instructions for installing River 5 on a client (Mac, Windows) but I haven't found any clear instructions for creating a River 5 server, hence this post. (I'm also a big fan of Dave's "For Poets" series - this is my feeble attempt at creating such a post.)
OK - let's get started!
You'll Need A Server
Running a server obviously requires you to have a server, right? Not necessarily - this is the age of the "cloud" and you can run your server "in the cloud" without having to buy it and maintain it. The "cloud" is just a trendy term for using someone else's computers for your own stuff. In this case someone else's computers will be Microsoft's Azure service and your own stuff will be River 5.
Wait - Microsoft is evil and proprietary isn't it?.
This is not the same old Microsoft. Azure supports several operating systems (not just Windows) and open source tools. Many Microsoft products and frameworks are now open source and available on Git.
Step One: Get an Azure subscription
This is the easiest step. Best of all it will enable you to explore the range of services and capabilities available in Azure once you're more comfortable with it. Signing up is easy. You'll even get $200 to spend so it won't cost you anything to set up your River5 server. Now go get signed up and come back here when you're ready.
Step Two: Pick a server
Remember, the cloud is nothing more than someone else's set of computers that you can use for your own stuff. Here's where we pick what type of computer we'll be using for our River 5 server.
Now that you have an Azure subscription, log into the Azure Management Portal.
When you first sign into Azure it may look a little intimidating because of all the stuff you can do. Don't worry about all that stuff at the moment, you can explore later. For now, click the + New and click Compute. You'll see a wide range or servers you can start up and use. As you can see it's not just Windows Servers. These are pre-configured special purpose servers designed for databases, SharePoint and more.
Your River 5 server will use the latest and greatest version of Windows Server: Windows Server 2016. Don't pick the one you see in the menu though, that's a much beefier server than you'll need for River 5. We're going to pick something simpler to use for our River 5 server. Click the See all blue text in the upper right corner.
Now click the Search box, type Windows Server 2016 and hit ENTER. Now pick Windows Server 2016 Technical Preview 4.
Another window will appear asking you about deployment model options. Accept the default setting and click Create.
Step Three: Configure, start up and login to your server
Enter your server name and define a userid and password (make a note of these - you'll need them to login soon). Select your Azure subscriptoin (created in the first step) and define a Resource Group. An Azure Resource Group is like a bucket containing all the information needed to manage the Azure service you're using. In our case the Resource Group will contain information about your server and it's networking capabilites. Lastly, pick a location where your server will be hosted. You should pick a location nearest you.
Once you've filled in this information click the OK button.
Now we need to select the size of our server. There are many server sizes available in Azure - from simple and cheap to highly complex and expensive. You'll initially be shown some recommended server sizes. Ignore the recommendations and click the View all blue text in the upper right corner.
Server sizes are identified by a letter/number combination but you can also see each the specifications associated with each server size. For this exercise we're going to pick the simplest server available: the A0. Scroll down the list until you locate the A0 then click on it. (Note: You'll see an estimated monthly cost for the server. You received a free $200 credit when you signed up so going through this exercise is free for you.)
Now click the Select button.
Back in the main menu again, pick the Public IP option, then pick Configuration. Here's where we give your server a friendly name so you won't have to type in an IP address to reach it. In this example I used "River5". The address you'll enter into your browser will be the name you enter plus the additional text that appears below it. In this example the address for my server will be http://river5.northcentralus.cloudapp.azure.com:1337 (:1337 is the port used by River5 - more about that in our next step). Make a note of your URL - you're going to use it later to access your River of news.
Now click Save at the top of the screen.
Now we're going to open up the ports that your server will use to communicate with a browser like Chrome or Internet Explorer. Click Network Security Group then click Inbound Security Rules. Add and save two inbound rules: one for port 80 and one for port 1337 as shown below. Remember to click the Save button after entering each port!
We'll use the defaults for the rest of the options. Now click the OK button and you'll see a summary of your server settings (on the far right):
Click the OK button. The setup will close and you'll land back on the Azure Management page. See that blue box? That's Azure deploying and starting up your new server for you. This may take a minute or so.
When your server is ready the blue box will change and look something like this:
Clicking on this box shows you information about your server. Click Connect from the menu at the top.
This will download the configuration to remotely log into to your server. Save this file to your desktop and double-click on it. You'll see the following warning message because you've never connected to this server before. Click Yes to continue to the login prompt for your new server.
Login with the userid and password you defined in step three above. After a delay your new server's desktop should appear. Congratulations! You now have your very own server!
Step Four: Server Housekeeping
We're almost ready to install River5. We need to clean up a few things to make your new server easier to use. Servers are very different from desktops machines - they are typically locked down to be secure. We're going to tweak some of these security settings to make your server easier for you to use.
If the Server Manager wizard appeared after you logged in, close it by clicking the "X" in the upper right corner.
First we're going to tweak a security setting that will enable you use the default browser known as Edge (servers are normally tightly locked down for security). Click the Windows logo in the lower left corner, type RUN and hit enter. This will pop up a command box. Type SECPOL.MSC into the command box and hit enter. The Local Security Policy Manager window will appear.
Click the Local Policies folder on the left and double-click Security Options on the right pane. Now scroll down until you see the User Account Control: Admin Approval Mode for the Built-In... option (as highlighted in the picture below). Double-click on it.
Click Enable then click OK to save. Click the X in the upper right of the Local Security Policy Manager to close it.
We're eventually going to have to restart your server to recognize the new security policy but not just yet. Remember how we set up the ports in a previous step? We're going to have to set up those ports in Windows Firewall to ensure they're working properly.
Hold down the Windows key and press X. Click on Control Panel in the pop-up menu. In Control Panel change the View By option to Small Icons. Now click Windows Firewall and the firewall configuration window will appear. Click Change Notification Settings on the left side of the window. Click to be notified when Firewall blocks an app, as shown below:
Now we need to open the ports we set up in Azure. Click the Advanced Settings from the left menu and click Inbound Rules. We're going to set up two rules for the two ports we opened up in Azure. Click New Rule from the menu on the right. Click Port.
Leave all the defaults and enter 1337 for the specific port. This is the port used by River5. Click Next, select Allow the Connection and cick Next.
Leave the defaults and click Next
Assign the connection a name and click OK to save it. You should also set up another Inbound rule for Port 80.
Your server housekeeping is now done! We just need to reboot the server because of the security policy change we made earlier. To do this click the Windows button (lower left corner of the screen), click Power then click Restart. If you get prompted for a reason click Unplanned and continue for the restart to occur. You'll lose your connection to the server when it restarts (the window will close).
Install and Set Up River 5 on Your New Server
Double-click on the configuration file you previously downloaded. Log back into your server. If the Server Manager wizard appeas click the "X" in the upper right corner to close it.
Hold down the Windows key and press R to pop up the Run prompt. Type cmd and hit ENTER. The Windows command line should appear.
- Type node -v and hit enter. Information about the version of node should appear.
- Type npm -version and hit enter. Information about the version of the Node Package Manager should appear.
We're finally ready to install River5! Using the Edge browser, download the River5 zip file.
Right-click on the file and select Extract All. You'll be prompted for the location you'd like to extract the files. I chose C:\Tools\River5 but you're welcome to choose whatever location you want.
Hold down the Windows key and press R to open the Run prompt. Type CMD and hit ENTER to open the command prompt again.
Navigate the folder where you extracted the River5 files. If you extracted the River5 files to C:\Tools\River5 use the following commands:
Once you're in this folder type npm install and hit ENTER. This will install River5 on your server for you.
After the install completes running type the following command and hit ENTER to start River5: node river5.js. You'll see some information scroll by about various news sites.
Open the Edge browser (on your server) and navigate to http://localhost:1337. It may take a while for some news feeds to appear so be patient. Eventually you will start seeing news feeds show up when you refresh the screen.
Set River5 to Start Automatically
You can set up River5 to automatically start in case your sever ever gets rebooted. This can be helpful in case of unexpected outages or restarts. First, create a simple batch file to run River5 by copying these commands and saving them into a file named run.cmd (note that you'll have to change the location of the River5 files if it differs from C:\tools\river5):
Hold down the Windows key and press R to open the Run prompt. Type regedit and press ENTER to open the Registry Editor. The Registry is a special configuration that Windows uses to store information about the various programs you have installed.
On the left side click HKEY_CURRENT_USER, then click SOFTWARE and scroll down to MICROSOFT.
Scroll down to Windows and double-click it to open the tree structure underneath it.
Look underneath the Windows folder, locate the CurrentVersion folder and double-click it to reveal the tree structure beneath it.
Scroll down to Run and single-click it.
In the right side you'll see a few folders. Right-click in an empty area and click New. Click String Value. A new item should appear on the right side. Name it River5 and hit ENTER.
Double-click on the River5 entry you just created. Type the full location of run.cmd into the Value box (e.g. C:\tools\river5\run.cmd).
You're finished. Close the Registry Editor by clicking the X in the upper right corner.
You can also close the window for your server. It's ready to use!
You can now access your River from anywhere using the URL you noted previously (mine is at http://river5.northcentralus.cloudapp.azure.com:1337).
See Dave's post for directions on configuring your own specific news feeds and other options. Pretty much eveything is configurable.