Dancerのインストール
普通にCPANからインストールします。$ perl -MCPAN -e shell cpan> install Dancer cpan> quit
Hello Worldを書く
bin/app.pl
#!/usr/bin/env perl
use Dancer ':syntax';
#use sharss;
get '/' => sub {
   'Hello, World!';
};
dance;
app.psgi
require 'bin/app.pl';
テスト実行
まず実行する。次に、http://localhost:3000/にアクセスして”Hello, World!”と表示されていればOK!perl app.psgi
リバースプロキシの設定
mod_proxyのインストール
sudo apt-get install libapache2-mod-proxy-html sudo apt-get install libxml2-dev
confファイルの設定
<Location "/test">
    RequestHeader set request-base /var/www/something
    ProxyPass http://localhost:3000
    ProxyPassReverse http://localhost:3000
</Location>それで少しハマりましたorz
mod_proxyの有効化
sudo a2enmod proxy sudo a2enmod proxy_http headers sudo /etc/init.d/apache2 restart
テスト
http://localhost/testでアクセスして”Hello, World!”と表示されればOK! [[amazon2][4873115671][4844328654]]I was annoyed something when I introduction of light Web framework Dancer for Perl.This article is the memo about that. References:
