Bug#395342: [pkg-lighttpd] Bug#395342: Debian lighttpd.conf not
compatible with "ruby on rails" app 1.1.6 when its public/image
directory is accessed
Krzysztof Krzyzaniak
eloy at kofeina.net
Fri Oct 27 11:26:30 UTC 2006
dllm70-boborosso at yahoo.com wrote:
> package:lighttpd
> version: 1.4.13-2
>
>
> Installed rails from rubygems and deployed an app. Rails app works but I couldn't access static content in (application path)/public/images even if permissions check.
>
> lighttpd displays the app-configured 404 page and rails logs utter:
>
> ActionController::RoutingError (Recognition failed for "/images/rails.png"):
> /var/lib/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:522:in `recognition_failed'
> /var/lib/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:512:in `recognize!'
> /var/lib/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'
> /var/lib/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'
> /var/lib/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'
> /usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi'
> /usr/lib/ruby/1.8/fcgi.rb:609:in `each'
> /usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi'
> /var/lib/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'
> /var/lib/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'
> /var/www/AreaSezione/public/dispatch.fcgi:24
>
> In fact renaming images to something else makes content accessible (breaking the rails app). The problems seems to be in this part of debian lighttpd.conf:
>
> #### handle Debian Policy Manual, Section 11.5. urls
> #### and by default allow them only from localhost
>
> $HTTP["host"] == "localhost" {
> global {
> alias.url += (
> "/doc/" => "/usr/share/doc/",
> "/images/" => "/usr/share/images/
> )
> }
> dir-listing.activate = "enable"
> }
This section was changed some versions ago to:
$HTTP["remoteip"] =~ "127.0.0.1" {
alias.url += (
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
$HTTP["url"] =~ "^/doc/|^/images/" {
dir-listing.activate = "enable"
}
}
please update it in your config file.
eloy
--
-------e-l-o-y---------------------------e-l-o-y- at -k-o-f-e-i-n-a-.-n-e-t------
jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej
More information about the pkg-lighttpd-maintainers
mailing list