Rails Lighttpd Issue on Fedora

Hi guys,

I’m here again with a problem. I have a rails app called brewed. It’s
located /home/user/brewed. My lighttpd.conf is located at
/home/user/lighty. When I execute lighty on port 80 with:
/usr/local/sbin/lighttpd -f /home/user/lighty/lighttpd.conf rails seems
to work fine.

If I type www.mysite.com/main/index on my browser, the page comes out
well. I have my files located on:
/home/user/brewed/app/views/main/index.rhtml

It does well, no issues up to this point. But when I start adding CSS,
images and javascripts located at /home/user/brewd/public, apparently it
doesn’t load. I even tried doing: www.mysite/myimage.jpg and I am
getting a 500 internal server error.

My lighttpd.access.log reflects this: “requesting ip” “mysite’s ip” -
[14/Jul/2006:19:47:16 +0800] “GET /images/final.jpg HTTP/1.1” 500 369
“-” “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4)
Gecko/20060508 Firefox/1.5.0.4”

On my lighttpd.error.log, I get this:

/home/user/brewed/public/images/final.jpg:1: Invalid char \377' in expression /home/user/brewed/public/images/final.jpg:1: Invalid char\340’ in
expression

On my fastcgi.crash.log, I get this:

[14/Jul/2006:19:49:51 :: 15945] starting
[14/Jul/2006:19:49:51 :: 15945] terminated gracefully

I really think that it’s just a lighttpd.conf problem bec using irb
lighttpd works just fine. Apparently, my lighttpd can not find
everything on my public folder.

Here is my lighttpd.conf:

Default configuration file for the lighttpd web server

Start using ./script/server lighttpd

server.bind = “0.0.0.0”
server.port = 80

server.modules = ( “mod_rewrite”, “mod_accesslog”,
“mod_fastcgi”, “mod_compress”, “mod_expire”, “mod_cgi” )

server.error-handler-404 = “/dispatch.fcgi”
server.document-root = CWD + “/public/”

server.errorlog = CWD + “/log/lighttpd.error.log”
accesslog.filename = CWD + “/log/lighttpd.access.log”

url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” =>
“$1.html” )

compress.filetype = ( “text/plain”, “text/html”, “text/css”,
“text/javascript” )
compress.cache-dir = CWD + “/tmp/cache”

expire.url = ( “/favicon.ico” => “access 3 days”,
“/images/” => “access 3 days”,
“/stylesheets/” => “access 3 days”,
“/javascripts/” => “access 3 days” )

Change *-procs to 2 if you need to use Upload Progress or other tasks

that

need to execute a second request while the first is still pending.

fastcgi.server = ( “.fcgi” => ( “localhost” => (
“min-procs” => 1,
“max-procs” => 1,
“socket” => CWD + “/tmp/sockets/fcgi.socket”,
“bin-path” => CWD + “/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “production” )
) ) )

cgi.assign = ( “.rb” => “/usr/local/bin/ruby”,
“.adp” => “/usr/local/bin/ruby”,
“” => “/usr/local/bin/ruby”)

mimetype.assign = (
“.css” => “text/css”,
“.gif” => “image/gif”,
“.htm” => “text/html”,
“.html” => “text/html”,
“.jpeg” => “image/jpeg”,
“.js” => “text/javascript”,
“.png” => “image/png”,
“.swf” => “application/x-shockwave-flash”,
“.txt” => “text/plain”
)

Making sure file uploads above 64k always work when using IE or Safari

For more information, see http://trac.lighttpd.net/trac/ticket/360

$HTTP[“useragent”] =~ “^(.MSIE.)|(.AppleWebKit.)$” {
server.max-keep-alive-requests = 0
}

Please help!

thanks,

Bing

Sorry on the 3rd paragraph:

/home/user/brewd/public is /home/user/brewed/public
Thanks,

bing

anyone pls?

thanks,

Bing

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs