User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Ruby section within the Web Development category of DaniWeb, a massive community of 427,025 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,539 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Ruby advertiser: SELL YOUR PRODUCT TODAY !
Views: 5242 | Replies: 2
Reply
Join Date: Oct 2005
Location: Manchester, UK
Posts: 482
Reputation: pty is on a distinguished road 
Rep Power: 3
Solved Threads: 33
pty's Avatar
pty pty is offline Offline
Posting Pro in Training

lighttpd.conf with rails

  #1  
Jul 6th, 2006
Just wondering if any rails experts could give me a hand with this problem.

I have rails/fcgi/lighttpd set up, when I use script/server it loads up fine. However if I try to run lighttpd as a service /etc/init.d/lighttpd start using the config file in /etc/lighttpd/lighttpd.conf it doesn't quite work.

It displays the welcome to rails message but in the "About your application's environment" box it has 404 error, I also get a 404 error when trying to view any dynamic pages.

Here is my lighttpd.conf file :

# lighttpd configuration file

server.modules      = ( 
	"mod_rewrite", 
	"mod_accesslog",
	"mod_redirect",
	"mod_fastcgi", 
	"mod_compress",
	"mod_expire",
	"mod_access"
)

server.pid-file             = "/var/run/lighttpd.pid"

server.error-handler-404 = "/var/www/bc/public/dispatch.fcgi"
server.document-root     = "/var/www/bc/public"

server.errorlog          = "/var/log/lighttpd.error.log"
accesslog.filename       = "/var/log/lighttpd.access.log"

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

compress.filetype        = ( "text/plain", "text/html", "text/css", "text/javascript" )
compress.cache-dir       = "/var/www/bc/tmp/cache"

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

fastcgi.server      = ( ".fcgi" => ( "localhost" => (
  "min-procs"       => 1, 
  "max-procs"       => 1,
  "socket"          => "/var/www/bc/tmp/sockets/fcgi.socket",
  "bin-path"        => "/var/www/bc/public/dispatch.fcgi",
  "bin-environment" => ( "RAILS_ENV" => "development" )
) ) )

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

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

Any ideas what could be causing my problems? Or any ideas where to look?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2005
Location: Manchester, UK
Posts: 482
Reputation: pty is on a distinguished road 
Rep Power: 3
Solved Threads: 33
pty's Avatar
pty pty is offline Offline
Posting Pro in Training

Re: lighttpd.conf with rails

  #2  
Sep 30th, 2006
I actually solved this the day after I posted but forgot to update it,

just needed to change

server.error-handler-404 = "/var/www/bc/public/dispatch.fcgi"

to


server.error-handler-404 = "dispatch.fcgi"
Note to self... pocket cup
Reply With Quote  
Join Date: Oct 2006
Posts: 1
Reputation: jnorris is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jnorris jnorris is offline Offline
Newbie Poster

Re: lighttpd.conf with rails

  #3  
Oct 11th, 2006
Thanks for posting this - found it by Google and saved me a lot of headache. =)

Jason
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Ruby Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Ruby Forum

All times are GMT -4. The time now is 2:51 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC