April 3, 2006

Gregarius aggregator succeeds with feeds

Author: Manolis Tzanidakis

Using Really Simple Syndication (RSS) or Atom feeds to check your favorite sites and blogs can be a big time-saver. However, if you use more than one computer or operating system, managing your feeds and tracking updates is more difficult. Gregarius, a Web-based server-side aggregator that supports RSS, RDF, and Atom feeds, can help.

Gregarius is written mainly in PHP, and available under the GNU General Public License (GPL). In order to run it you need a Web server, SQL database, and PHP with the appropriate extensions for accessing the database of your choice. Apache, with the mod_rewrite module, is the preferred Web server for Gregarius, although you can use other Web servers as well. The program supports MySQL and SQLite databases, and PostgreSQL support is on the way for an upcoming version.

Installation is pretty straightforward. Download the most recent release (0.5.2a at the time of this writing), uncompress it on your Web server, and follow the instructions in the INSTALL file on how to create the required database and configure the program to use it. If you have problems with your installation, make sure to check the project's documentation.

I installed Gregarius on my Web server, running OpenBSD 3.8-STABLE, Apache 1.3.29 (from the base installation, non-chrooted), MySQL 4.0.24, and PHP 5.0.4. Note that the default Apache configuration on OpenBSD doesn't allow overrides from .htaccess, so something like the following is required in your httpd.conf on OpenBSD if you're going to use htaccess with Gregarius:

<Directory "/var/www/htdocs/rss">
AllowOverride All
</Directory>

Replace /var/www/htdocs/rss with the directory you unpacked Gregarius to.

Also, make sure to enable the mod_rewrite module by uncommenting this line in your httpd.conf:

LoadModule rewrite_module /usr/lib/apache/modules/mod_rewrite.so

You may need to take different steps to run Gregarius on other operating systems, depending on the default Apache configuration.

Fire it up

The first time you run Gregarius you should enter the Admin page to configure the program's options according to your needs, and to add some feeds of course. Configuration options have detailed explanations, so you shouldn't have any trouble.

Gregarius has excellent Outline Processor Markup Language (OPML) import/export support; I was able to import all my feeds from my previous aggregator, Liferea, without any hassle. Exporting feeds from Gregarius back to Liferea worked fine too.

If your Web server is exposed to the Internet, you should password-protect the Admin section; see the password protection page for instructions. I'd advise you to use SSL encryption and Apache's password authentication for additional security.

If Gregarius' default features aren't enough, you can enable a number of additional features -- such as submitting an item to your del.icio.us account, or to a blog, with one click -- with plugins. The application's interface is well-designed and appealing to the eye, but you can further customize your installation using themes.

When you've completed the setup of the program you should configure it to update your feeds. Gregarius supports three update methods: HTTP Push, AJAX, and update in the background with cron.

Gregarius uses HTTP Push by default if your browser supports it. This mechanism updates the feeds sequentially and prints out the result of each update process before it starts fetching the next feed. Right now, HTTP Push is only supported by Opera and Gecko-based browsers, such as Mozilla, Firefox, and Netscape. Future versions of Internet Explorer may support it too.

You can enable update using AJAX by setting rss.config.serverpush to false in Admin -> Config. This method is more resource-intensive than the other two since the complete update page is rendered first and then the server is queried repeatedly for each feed it should update.

Update in the background basically works by having wget or curl access http://yoursite.com/rss/update.php?silent periodically with cron.

I prefer updating via cron, and have the following entry in my crontab to update my feeds every two hours:

* */2 * * * wget -q -O /dev/null "http://localhost/rss/update.php?silent"

If you don't have access to cron on your Web server, and your Gregarius installation is accessible from the Internet, you can use something like this hack, which polls the URL every two hours, instead.

For the last two months I've been using Gregarius as my aggregator, and I really like it. The project is under active development, and many interesting features are in the works. Check the project's roadmap and developers' blog for more information. The developers also provide a demo page, so you can try Gregarius before you decide whether to install it.

Click Here!