# Downloads dispatch.fcgi for every request!

**URL:** <https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250>\
**Category:** Rails\
**Created:** [May 25, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250 "2006-05-25T18:21:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [May 25, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250/1 "2006-05-25T18:21:02Z")

</div>

Hi All, has anyone ever seen it when they vist the URL in the applicaion  
that it just tries to download the FCGI dispatch file?

Im running FC3, Lighttpd1.4.11, Rails 1.1.2 and FastCGI.

i run IRB and get…

irb(main):001:0\> require ‘fcgi.so’  
=\> true

irb(main):001:0\> require ‘fcgi’  
=\> true

On the default rails install page ‘riding on rails’… it should display  
the server details about your enviroment, but it doesnt execute the FCGI  
i dont think. As it doesnt display the info, but at the same time it  
doesnt error either.

Has anyone got any ideas? im a bit stuck!!

thanks

tim

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [May 25, 2006, 6:28pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250/2 "2006-05-25T18:28:42Z")

</div>

Show us the lighty config, and make sure dispatch.fcgi is  
executable.

–  
– Tom M.

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [May 25, 2006, 6:31pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250/3 "2006-05-25T18:31:55Z")

</div>

The lighty config is…

var.basedir = “/var/www/sites/”

$SERVER[“socket”] == “101.0.0.171:80” {

var.servername = “[stage.butlerandtanner.com](http://stage.butlerandtanner.com)”

server.document-root = basedir + servername + “/public/”

# rewrite rules for rails

url.rewrite = ( “^/$” =\> “index.html”, “^([^.]+)$” =\> “$1.html” )  
server.error-handler-404 = “/dispatch.fcgi”

fastcgi.server = (  
basedir + servername + “/public/dispatch.fcgi” =\>  
( “localhost” =\>  
( “socket” =\> basedir + servername + “/tmp/sockets/fcgi.socket”,  
“min-procs” =\> 2,  
“max-procs” =\> 4,  
“max-load-per-proc” =\> 2,  
“bin-path” =\> basedir + servername + “/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “production” )  
)  
)  
)

}

The dispatch.fcgi is chmod to 755

Any ideas?

thanks

Tim

Tom M. wrote:

> Show us the lighty config, and make sure dispatch.fcgi is  
> executable.
> 
> –  
> – Tom M.

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [May 25, 2006, 8:41pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250/4 "2006-05-25T20:41:23Z")

</div>

hmmmm, anyone got any ideas?

Thanks

Tim

---

<div class="post-metadata">

**Author:** ![timperrett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Post date:** [May 25, 2006, 6:36pm UTC](https://www.ruby-forum.com/t/downloads-dispatch-fcgi-for-every-request/95250/5 "2006-05-25T18:36:54Z")

</div>

Additionaly… if i run the fcgi file from the command line, i get an  
error as you would expect

[root@localhost www]# ruby  
/var/www/sites/stage.butlerandtanner.com/public/dispatch.fcgi  
Status: 500 Internal Server Error  
Content-Type: text/html

# Application error

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html

[root@localhost www]#
