このページを参考に。
apt-get install libapache2-mod-fcgid
apt-get install libfcgi-dev
gem install fcgi
#!/usr/bin/ruby require 'rubygems' require 'fcgi' FCGI::each do |req| req.out.puts "Content-Type: text/plain\n\n" req.out.puts "Hello, FastCGI" req.finish end