Gregarius under LightTPD and FastCGI

Not one to hang around, I decided to give Gregarius a whirl instead of just talking about it. You can find it at http://lakelandedge.co.uk/rss/.

Install was pretty simple as expected, but there were a few gotchas specific to my (and possibly others) configuration as I’m running LightTPD with FastCGI, so I’ll cover them here:

  • It thinks it’s running in the root of your site no matter where it is installed. This is caused by PHP_SELF being empty, for which a solution can be found here
  • It use Apache’s mod_rewrite by default (an understandable, but unfortunate assumption on the developers part)

To save solving these yourself, here are some tailored instructions…

Tailored Install Instructions

  1. Follow the standard install instructions (which recursively links to this post!), but don’t go anywhere near your browser yet!
  2. Modify your php.ini, so that cgi.fix_pathinfo is 1
  3. Now you can browse to you installation
  4. Before proceeding any further, go to the http://example.com/rss/admin/index.php?domain=config (changing the domain & path to suit obviously) and toggle rss.output.usemodrewrite to off
  5. Start using it!

At some point, I may figure out the conversion of the rewrite rules to suit lighttpd, but at the moment I’m not to bothered as I prefer the un-rewritten URLs.

robots.txt

I prefered not to have my installation indexed (whilst googling for tips, I encountered lots of links pointing to feeds within Gregarius installations – very annoying), so I modified my robots.txt accordingly.

Authentication

I went with htdigest protection, but I sure you can figure out how to use basic.

  1. Create a disgest file – I used htdigest from my previous Apache installation
  2. Add the following lines to your lighttpd.conf (in the relevant domain section if you’re hosting multiple sites:
    
    auth.backend = “htdigest”
    auth.backend.htdigest.userfile = ”/path/to/digest_file”
    auth.require = ( ”/rss/admin/” =>
                     (
                       “method”  => “digest”,
                       “realm”   => “Gregarius”,
                       “require” => “valid-user”
                     )
                   )
    
    
  3. Reload lighttpd and check everything is as expected.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

2 Responses to “Gregarius under LightTPD and FastCGI”

  1. Sameer says:

    Nice work. Well Gregarius only supports apache officially, but it has been known to work even on IIS.(ugh)

    Just a couple of quick points.

    * modrewrite will be turned off by default in the next released

    * you will need to move your robots.txt file into your root directory for it to be effective. Editing the rss.config.robots option usually works better.

  2. Mike says:

    Ah, thanks for that – it answered a question I had about lighttpd authentication. I’ve been experimenting a bit with it myself, both as a back end for Rails applications (where it’s very, very fast) and for use with <a href="http://www.edgewall.com/trac/" rel="nofollow">Trac</a> as part of my multi-pronged approach to persuading a bunch of developers that no, they really DO want to migrate their source repositories from CVS to Subversion.