Plager Serverをdebianで動かすときの備忘録

ここを参考にしていれてみよう
http://blog.yappo.jp/yappo/archives/000428.html

とりあえず svnからcoしてみて動くかとおもったんだけど、どうもダメだった。

debianだし、perlのモジュールも自分でパッケージしたりしてるが、
以下、備忘録

まずアクセスできない

examplesの中のyamlをもってきて、加工

global:
  plugin_path:
  timezone: Asia/Tokyo

plugins:
  - module: Aggregator::Simple
  - module: Server::Engine::PreFork

  - module: Server::Protocol::HTTP
    config:
        port: 10080
        host: 127.0.0.1

  - module: Server::Pull::SimpleBbs
    rule:
      expression: $args->{req}->protocol->service eq 'http' && $args->{req}->protocol->uri->path =~ m!^/bbs! && $args->{feed}->link =~ m!^pserv://bbs/!

  - module: Subscription::Config
    config:
      feed:
        - url: file:///tmp/multibbs.xml

  - module: Publish::Feed
    config:
      format: RSS
      dir: /tmp
      filename: multibbs.xml

http://localhost:10080/bbs
にアクセスしたら

connection reset

みたいなことをいわれて、ブラウザのエラー画面しかみれず

lib/Plagger/Plugin/Server/Engine/PreFork.pm

のなかを見てみて、いろいろ変数をlog debugに書き出してたら

sub process_requestの中の

if ($server->{proto} eq $protocol->proto &&

こいつの

$server->{proto}

が Array を返していたので、dumpしてみたら $server->{proto}[0] が "tcp" だったので

if ($server->{proto}[0] eq $protocol->proto &&

としてみた。

これでアクセス。エラーはなくなった

しかし何もでない

ブラウザには何もでてこないがplaggerdログみたら進んでいるようだったので、

/tmp/multibbs.xml

がないのかなぁとおもい、touchして作ってみたが、ダメ。。。

Plagger::Plugin::Aggregator::Simple [debug] 200: file:///tmp/multibbs.xml
Plagger::Server [error] file:///tmp/multibbs.xml is not aggregated by any aggregator

空じゃだめなんだろうなぁとおもい
YappoさんのWinkを凝視した結果、/tmp/multibbs.xml に中身があることがわかったので、中身を作る

<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title>PlaggerServer BBS</title>
<link>pserv://bbs/</link>
<description></description>
<pubDate>Thu, 11 May 2006 04:34:00 +0900</pubDate>
<generator>Plagger/0.6.5</generator>

</channel>
</rss>

これで、起動したら、BBSの画面でてきた
普通に考えれば、Subscriptionが空でいいわけがない。。>自分

書き込めず。。。

書き込んでみたんだけど、書き込み後の画面が真っ白。
ログみたらまたも

Plagger::Plugin::Aggregator::Simple [debug] 200: file:///tmp/multibbs.xml
Plagger::Server [error] file:///tmp/multibbs.xml is not aggregated by any aggregator

と、でていたので
とりあえず /tmp/multibbs.xmlをみてみた


  
    Plagger/0.7.3
    pserv://bbs/
    PlaggerServer BBS
    Wed, 31 Jan 2007 21:40:29 +0900
    
      aaa
      aaa
      pserv://bbs/1170247229
      cccc
      2007-01-31T21:40:29
      bbb
      Wed, 31 Jan 2007 21:40:29 -0000
      cccc
    
  

うーむ、どこがどうおかしいのやら。。。

lib/Plagger/Plugin/Server.pm

をみてみたんだけど特にそれっぽい記述もないので

lib/Plagger/Plugin/Aggregator/Simple.pm

をみてたら

sub looks_like_feed {
    my($self, $content_ref) = @_;
    $$content_ref =~ m!<rss\s+version="|<rdf:RDF\s+xmlns="http://purl\.org/rss|<feed\s+xmlns="!s;
}

とりあえず、ここがそれっぽかったので、さっきのxmlからそれっぽいところを追加

sub looks_like_feed {
    my($self, $content_ref) = @_;
    $$content_ref =~ m!<rss\s+version="|<rdf:RDF\s+xmlns="http://purl\.org/rss|<feed\s+xmlns="|<rss\s+xmlns:dc="http://purl.org/dc!s;
}

再起動したら

うごきました。

SimpleBbsしか使っていないので、他のものがこれで動くかもわかりません。