I am trying to set-up lighttpd and rails to work with fastcgi.
Here is what I am currently using for the virtual host definition. I
have gotten this from various websites. Sorry about the formatting I
can''t seem to control it with Thunderbird.
var.wholesale = "wholesale"
$HTTP["host"] =~ "^wholesale" {
server.document-root = "/var/lighttpd/" + var.wholesale +
"/public"
accesslog.filename = "/var/lighttpd/" + var.wholesale +
"/log/lighttpd.log"
#url.rewrite = ( "^/$" => "index.html",
"^([^.]+)$" => "$1.html" )
server.indexfiles = ( "dispatch.fcgi", "index.html" )
server.error-handler-404 = "/dispatch.fcgi"
fastcgi.server = ( ".fcgi" =>
( "localhost" =>
( "min-procs" => 2,
"max-procs" => 2,
"socket" => "/tmp/" + var.wholesale +
".fcgi.socket",
"bin-path" => "/var/lighttpd/" + var.wholesale +
"/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" =>
"development" )
)
)
)
url.rewrite = ("^/$" =>
"/dispatch.fcgi?controller=home&action=index2",
"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$"
=>
"/dispatch.fcgi?controller=$1&action=$2&id=$3&$4",
"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$"
=>
"/dispatch.fcgi?controller=$1&action=$2&$3",
"^/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" =>
"/dispatch.fcgi?controller=$1&action=index&$2"
)
cgi.assign = (".rb" => "/usr/bin/ruby",
".cgi" => "/usr/bin/ruby")
}
A couple of seconds after starting lighttpd I get this message repeated
twice.
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:155:in
`read'': No such file or directory -
/var/lighttpd/wholesale/public/../config/../config/environments/devlopment.rb
(Errno::ENOENT)
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:155:in
`load_environment''
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/core_ext/kernel.rb:27:in
`silence_warnings''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:152:in
`load_environment''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:81:in
`process''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in `run''
from /var/lighttpd/wholesale/public/../config/environment.rb:10
from /var/lighttpd/wholesale/public/dispatch.fcgi:22
The file "devlopment.rb" does exist
$> ls -l /var/lighttpd/wholesale/config/environments/development.rb
-rw-r--r-- 1 neil neil 800 Jan 20 15:01
/var/lighttpd/wholesale/config/environments/development.rb
Any help appreciated
Regards Neil.