Using Raspberry Pi to host an alternative to Google Reader

Mar 17, 2013 22:41

I'll leave the wailing about the demise of Google Reader for the wild early morning hours where there are tears and a keening liable to wake the neighbors  But to be positive I thought I would find an alternative and quite a few of the pre-canned solutions on the cloud don't really seem that great. The best I could find was http://netvibes.com which provides widgets but also a Reader style interface at a push of a button.

The alternative I thought might be interesting to try is to use a Raspberry Pi running Raspbian Linux with Lighttp, PHP and MySQL providing the back end to an application called Tiny Tiny RSS (TT-RSS). It has a web interface but there is also a basic Android app that can connect using the API as well.

Build Raspbian
I found a 4GB SD card wasn't large enough and I'm now running on an 8GB SD card (Raspbian kept failing install before I could actually check the disk usage but a new card did the trick).

Raspbian was pretty easy as you just copy the appropriate files onto the SD card and boot it in the RaPi. It does a network install so you need the network up and DHCP running on the LAN. http://www.raspbian.org/RaspbianInstaller gives a quick walk through.

Install Underlying Software
You'll need MySQL installed (apt-get install mysql-server). Once done you'll need a new user (ttrss but what you like) and a new database (ttrss but again call it what you like).

I don't know a lot about Lighttpd, I used it because it's less intensive than Apache (which was the alternative) and using new software is always good for learning something new.

PHP5 is pretty easy to install (apt-get PHP5) but you'll also need PHP5-mysql, PHP5-cgi, PHP5-cli.

Lighttpd calls modules listed in /etc/lighttpd/conf-enabled and I ended up enabling 10-accesslog.conf 10-cgi.conf 15-fastcgi-php.conf and a version of 10-simple-vhost.conf (which was amended to allow me to define DNS for the server and deliver traffic directly to the approriate directory). All of this is in the Lighttd install instructions (http://www.lighttpd.net/ was less useful) http://redmine.lighttpd.net/projects/1/wiki/TutorialLighttpdAndPHP did prove useful.

Installing tt-rss was easy, it's documented well on their website (http://tt-rss.org/redmine/projects/tt-rss/wiki) and just involved unpacking tt-rss into a directory in the web root. I renamed it from TinyTinyRSS-x.x.x to tt-rss in /var/www. Once that's done you need to copy config.php-dist to config.php and enter your DB user/pass and database name etc. This is all documented here: http://tt-rss.org/redmine/projects/tt-rss/wiki/InstallationNotes . You also need to create the MySQL database scheme using the script in /var/www/tt-rss/schema/ttrss_schema_mysql.sql. (This is done with 'mysql -u ttrss -p ttrss < /var/www/tt-rss/schema/ttrss_schema_mysql.sql' and then giving the password.)

At this point you should, if you restart the lighttpd server and everything it working you should be told to chmod a few files if you browse to http://yourserver/tt-rss. Once that's done you should be able to log in as admin/password (and immediately change the password).

Try it out
At this point you probably want to add a couple of test RSS feeds so you can tell if it's working, although I actually just imported all my RSS feeds and hoped for the best. I was lucky.

Get the Feeds Updating Automatically
The bit I found harder was the daemon to update the subscriptions. The documentation in tt-rss is here http://tt-rss.org/redmine/projects/tt-rss/wiki/UpdatingFeeds. Basically you cannot run the update daemon as root so I ended up using a very basic shell script while I try and work out the correct way to do this.

#!/bin/sh
su - www-data -c 'nohup /usr/bin/php /var/www/tt-rss/update_daemon2.php&'

It used to be much easier to write start / stop scripts in debian but I haven't caught up with the start-stop-daemon yet.

Import Google Reader Subscriptions
I managed to export my Google Reader subscriptions easily (I can't find the documentation I used but it was easy). It produces a OPML file that can then be imported into tt-rss using Actions/Preferences/Feeds/OPML and selected the exported file.

Post installation followup activity
I only got this running this evening so I will have to hope the disk doesn't fill up, the RaPi doesn't over heat and set fire to the curtains and that PHP isn't quite as vulnerable as it used to be.

webapps, rapi

Previous post
Up