# RoR, Apache2, fcgid and ubuntu

**URL:** <https://www.ruby-forum.com/t/ror-apache2-fcgid-and-ubuntu/156987>\
**Category:** Deployment\
**Created:** [January 6, 2009, 7:48am UTC](https://www.ruby-forum.com/t/ror-apache2-fcgid-and-ubuntu/156987 "2009-01-06T07:48:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [January 6, 2009, 7:48am UTC](https://www.ruby-forum.com/t/ror-apache2-fcgid-and-ubuntu/156987/1 "2009-01-06T07:48:04Z")

</div>

Hi.  
I’m trying to deploy my rails application on ubuntu server using apache2  
and fcgid…but have not been successful…  
I am using ruby 1.8.6, rails 2.2.2 and fcgi 0.8.7 gem…  
I am able to start apache successfully and view the Aptana RadRails  
welcome page…But giving my controller’s name gives me a 404 error…  
I have made required changes in my /public/.htaccess and  
/public/dispatch.fcgi files…as=\>

.htaccess(w/o comments)

AddHandler fastcgi-script .fcgi  
AddHandler fcgid-script .fcgi  
AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI  
dispatch._fcgi_  
RewriteEngine On  
RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

## Application error
Rails application failed to  
start properly”

dispatch.fcgi

#!/usr/bin/ruby  
require File.dirname( **FILE** ) + “/…/config/environment”  
require ‘fcgi\_handler’  
require ‘rubygems’  
require\_gem ‘fcgi’  
RailsFCGIHandler.process!

I am attaching my httpd.conf file…

I have checked that my VirtualHost works perfectly…but it doesn’t seem  
to start my rails application…

Can someone please tell me where am I going wrong???  
Thanks in advance…

---

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [January 8, 2009, 6:41am UTC](https://www.ruby-forum.com/t/ror-apache2-fcgid-and-ubuntu/156987/2 "2009-01-08T06:41:11Z")

</div>

Hey…  
As this was not working…  
I switched to Phusion passenger and ruby enterprise edition…  
Now I have my site up and running… :)).

Jeba M. wrote:

> Hi.  
> I’m trying to deploy my rails application on ubuntu server using apache2  
> and fcgid…but have not been successful…  
> I am using ruby 1.8.6, rails 2.2.2 and fcgi 0.8.7 gem…  
> I am able to start apache successfully and view the Aptana RadRails  
> welcome page…But giving my controller’s name gives me a 404 error…
> 
> Can someone please tell me where am I going wrong???  
> Thanks in advance…
