# FastCGI setup : public/dispatch.fcgi

**URL:** <https://www.ruby-forum.com/t/fastcgi-setup-public-dispatch-fcgi/52324>\
**Category:** Ruby-Forum\
**Created:** [January 12, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/fastcgi-setup-public-dispatch-fcgi/52324 "2006-01-12T20:49:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsroad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@railsroad](https://www.ruby-forum.com/u/railsroad)\
**Post date:** [January 12, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/fastcgi-setup-public-dispatch-fcgi/52324/1 "2006-01-12T20:49:56Z")

</div>

I’m still attempting to get rforum set up on a shared host.

I’m attempting to follow the fastCGI instructions here:  
[http://wiki.rubyonrails.com/rails/pages/FastCGI](http://wiki.rubyonrails.com/rails/pages/FastCGI)

However, the instructions do not match what I see.

I’m supposed to change in public/dispatch.fcgi

The documentation says to change:

> require ‘fcgi’

to:

> require ‘rubygems’  
> require\_gem ‘fcgi’

Of course, the closest thing I can find to that is:  
require ‘fcgi\_handler’

Can anyone recommend a current tutorial on how to setup FastCGI?

I don’t understand Apache and/or Rails enough to recognize what should  
be changed and what should remain the same.

* * *

Seeking Confirmation about this as well:

I’m also curious about the changes I’m supposed to make the the  
.htaccess file.  
The wiki I’m following has the next step as

in public/.htaccess change

RewriteRule ^(.\*)$ /dispatch.cgi?$1 [QSA,L]

to

RewriteRule ^(.\*)$ /dispatch.fcgi?$1 [QSA,L]

To my understanding, I think the file that needs to be changed is  
actually located in:  
public\_html/.htaccess

Confirmation that I’m correct about that is appreciated.

thanks,  
B

---

<div class="post-metadata">

**Author:** ![railsroad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@railsroad](https://www.ruby-forum.com/u/railsroad)\
**Post date:** [January 13, 2006, 3:55pm UTC](https://www.ruby-forum.com/t/fastcgi-setup-public-dispatch-fcgi/52324/2 "2006-01-13T15:55:43Z")

</div>

All I know is I changed the former and it all works fine

---

<div class="post-metadata">

**Author:** ![railsroad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@railsroad](https://www.ruby-forum.com/u/railsroad)\
**Post date:** [January 13, 2006, 6:39pm UTC](https://www.ruby-forum.com/t/fastcgi-setup-public-dispatch-fcgi/52324/3 "2006-01-13T18:39:08Z")

</div>

I changed  
require ‘fcgi\_handler’

to:  
require ‘rubygems’  
require\_gem ‘fcgi’

## Now, I’m getting this error:

You don’t have permission to access /dispatch.fcgi/ on this server.

## Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I have checked the permissions and they’re 777

This actually brings up an interesting Topic.

What do the permissions for Rforum to run on a a shared host?

this is Home:

drwxr-x— 3 XXXXXX XXXXXX 4096 Dec 14 18:20 public\_ftp  
drwxr-xr-x 2 XXXXXX XXXXXX 4096 Jan 12 18:54 public\_html  
drwxr-xr-x 3 XXXXXX XXXXXX 4096 Jan 6 12:19 rforum

and here is an LS -LA for the Rforum app:  
drwxr-xr-x 15 xxxxxx xxxxxx 4096 Jan 11 16:07 .  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:19 …  
drwxr-xr-x 7 xxxxxx xxxxxx 4096 Jan 6 12:20 app  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:21 attachments  
drwxr-xr-x 4 xxxxxx xxxxxx 4096 Jan 10 17:15 config  
drwxr-xr-x 4 xxxxxx xxxxxx 4096 Jan 6 12:21 db  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:22 ferret\_index  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:22 lang  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:22 lib  
-rw-r–r-- 1 xxxxxx xxxxxx 1059 Jan 6 12:22 LICENSE  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:22 log  
drwxr-xr-x 7 xxxxxx xxxxxx 4096 Jan 13 12:13 public  
-rwxr-xr-x 1 xxxxxx xxxxxx 1767 Jan 6 12:23 Rakefile.rb  
-rw-r–r-- 1 xxxxxx xxxxxx 1024 Jan 11 16:07 README  
drwxr-xr-x 5 xxxxxx xxxxxx 4096 Jan 6 12:23 script  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:23 server  
drwxr-xr-x 7 xxxxxx xxxxxx 4096 Jan 6 12:19 .svn  
drwxr-xr-x 7 xxxxxx xxxxxx 4096 Jan 6 12:25 test

and lastly here is the rforum/trunk/public LS -LA  
-rw-r–r-- 1 xxxxxx xxxxxx 99 Jan 6 12:22 404.html  
-rw-r–r-- 1 xxxxxx xxxxxx 69 Jan 6 12:22 500.html  
-rwxr-xr-x 1 xxxxxx xxxxxx 479 Jan 6 12:22 dispatch.cgi  
-rwxrwxrwx 1 xxxxxx xxxxxx 874 Jan 13 12:13 dispatch.fcgi  
-rwxr-xr-x 1 xxxxxx xxxxxx 479 Jan 6 12:22 dispatch.rb  
-rw-r–r-- 1 xxxxxx xxxxxx 4710 Jan 6 12:22 favicon.ico  
-rwxr-xr-x 1 xxxxxx xxxxxx 2550 Jan 6 12:22 .htaccess  
drwxr-xr-x 4 xxxxxx xxxxxx 4096 Jan 6 12:22 images  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:22 javascripts  
-rw-r–r-- 1 xxxxxx xxxxxx 43 Jan 6 12:22 robots.txt  
drwxr-xr-x 8 xxxxxx xxxxxx 4096 Jan 6 12:23 skins  
drwxr-xr-x 3 xxxxxx xxxxxx 4096 Jan 6 12:23 stylesheets  
drwxr-xr-x 7 xxxxxx xxxxxx 4096 Jan 6 12:22 .svn

Are those permission correct?

Which need to be changed?

thanks,  
Bryan
