Running Parley with fastcgi

Today I hope to show you how to run Parley under fastcgi.

If all goes well I’ll have a publically visible message board by the end of the post.

I’m assuming you’ve already installed Parley.

For this entry you’ll need to have acess to a user with sudo superpowers.

Create a new site

First we’ll add a new site to the apache configuration:

sudo vim /etc/apache2/sites-available/parley.named_vhost

and add the following:

<VirtualHost *:80>

  DocumentRoot            /home/parley/perl5/lib/perl5/Parley/root
  Alias           /static /home/parley/perl5/lib/perl5/Parley/root/static
  Alias           /       /home/parley/perl5/bin/

  FastCgiServer           /home/parley/perl5/bin/ -processes 3

  # stuff that's good to have
  ErrorLog            /home/parley/parley/
  CustomLog           /home/parley/parley/ common

Save the file, and create a folder we’ll need:

sudo install -d -o parley -g parley /home/parley/parley/

Enable the site:

sudo a2ensite parley.named_vhost
sudo /etc/init.d/apache2 reload

Start the Email Engine

If you want activation emails to be processed you’ll need to start the email processing daemon:

# as 'parley' user

A Quick Hack

For a reason I’ve yet to determine, I was seeing an error in the logs when I reloaded apache:

[Fri Aug 13 16:37:53 2010] [warn] FastCGI: server "/home/parley/perl5/bin/" restarted (pid 4758)
Can't locate in @INC (@INC contains:
    /home/parley/perl5/bin/../lib /etc/perl ...)
    at /home/parley/perl5/bin/ line 15.

I hacked this by editing /home/parley/perl5/bin/ and adding the perl5 line:

use FindBin;
use lib "$FindBin::Bin/../lib";
use lib "$FindBin::Bin/../lib/perl5";
use Parley;

I’m sure I’ve done something stupid, but for now … it’ll do.

Allowing User Avatars

Until I find a better way of doing this (i.e. using gravatar like I did with you’ll need to make a writable directory for user avatars:

sudo install -o www-data -g parley -m 0770 -d ~parley/parley/
ln -s $HOME/parley/ /home/parley/perl5/lib/perl5/Parley/root/static/user_file

Not Perfect

I know there are still areas where Parley needs some work. It’s been left, neglected, in a box for a year.

It’s usable, and now - finally - has a public demo.

The Application

You should be able to explore Parley by visiting in your browser.

Leave a comment

About Chisel

user-pic I blog about Perl.