fastcgi(IIPImage)をroot以外でデバッグするための設定

今までずっとNetBeansをroot起動してたけど
あまりにもいろいろと面倒だったので。
IIPImageはコマンドラインからポート指定で起動でき、
Apache側で指定されたfcgiのパスを特定のホスト:ポートへ
リダイレクト出きるみたいだったのでやってみたら意外と簡単にできた。

  • ログインユーザーでfastcgiを起動(コマンドライン)

    $ iipsrv.fcgi --bind xxx.xxx.xxx.xxx:9000
    
  • mod_fastcgiをインストール

    $ sudo apt-get install libapache2-mod-fastcgi  
    
  • apacheの設定にfcgi-binのScriptAliasとディレクトリ、fcgiのパス設定を書く
    面倒くさくて試してないけど多分ScriptAliasやDirectoryの設定はいらない気がする。

    ScriptAlias /fcgi-bin/ "/path/to/fcgi-bin/"  
    
    <Directory "/path/to/fcgi-bin/">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    
        Header append Access-Control-Allow-Origin: *
    
        # Set the module handler
        AddHandler fcgid-script .fcgi
    </Directory>
    
    FastCGIExternalServer /path/to/fcgi/url/xxx.fcgi -host xxx.xxx.xxx.xxx:9000