Rails on LightTPD.

コマンドで見るシリーズ。~ LightyとFastCGIとRailsと ~

LightTPD

wget http://www.lighttpd.net/download/lighttpd-1.4.11.tar.gz
tar zxf lighttpd-1.4.11.tar.gz
cd lighttpd-1.4.11
./configure --prefix=/usr/local/lighttpd14
make && make install
ln -s /usr/local/lighttpd14 /usr/local/lighttpd

FastCGI

wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar zxf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure --prefix=/usr/local/fcgi24
make && make install
ln -s /usr/local/fcgi24 /usr/local/fcgi

ruby-fcgi

wget http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz
tar zxf ruby-fcgi-0.8.6.tar.gz
cd ruby-fcgi-0.8.6
ruby install.rb config -- --with-fcgi-include=/usr/local/fcgi/include --with-fcgi-lib=/usr/local/fcgi/lib
ruby install.rb setup
ruby install.rb install

設定ファイル:/usr/local/lighttpd/etc/lighttpd.conf

server.port = 81
server.bind = "192.168.0.10"
server.modules = ( "mod_rewrite", "mod_fastcgi" )
url.rewrite = ( "^/$" => "/index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/path/to/app/public/"
server.errorlog = "/path/to/app/log/error.log"
fastcgi.server = ( ".fcgi" =>
( "localhost" =>
(
"min-procs" => 1,
"max-procs" => 5,
"socket" => "/tmp/app.fcgi.socket",
"bin-path" => "/path/to/app/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" )
)
)
)

起動

/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/etc/lighttpd.conf
タイトルとURLをコピーしました