# Application failed to start for subdomain

**URL:** <https://www.ruby-forum.com/t/application-failed-to-start-for-subdomain/58810>\
**Category:** Rails\
**Created:** [April 26, 2006, 4:33am UTC](https://www.ruby-forum.com/t/application-failed-to-start-for-subdomain/58810 "2006-04-26T04:33:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mshah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@mshah](https://www.ruby-forum.com/u/mshah)\
**Post date:** [April 26, 2006, 4:33am UTC](https://www.ruby-forum.com/t/application-failed-to-start-for-subdomain/58810/1 "2006-04-26T04:33:15Z")

</div>

I recently setup a subdomain to run my app as a staging site before  
pushing  
changes to the main site. So i setup a subdomain in cpanel, symlinked  
that  
the directory to point to a staging directory where i check’d out my  
rails  
app.

However, when i go to [staging.railsapp.com](http://staging.railsapp.com), it times out and says  
application failed to start properly.

I’m not sure what is causing this, but i’m thinking that it has  
something to  
do with dispatch.fcgi. Right now in httpd.conf, i have the  
FastCGIServer  
pointing to dispatch.fcgi in my main app. Can that dispatch.fcgi file  
also  
route requests for my staging subdomain?

If not, how can i start another dispatch.fcgi process to route requests  
for  
my staging site?

Thanks so much for all your kind help.

---

<div class="post-metadata">

**Author:** ![mshah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@mshah](https://www.ruby-forum.com/u/mshah)\
**Post date:** [April 26, 2006, 7:55am UTC](https://www.ruby-forum.com/t/application-failed-to-start-for-subdomain/58810/2 "2006-04-26T07:55:31Z")

</div>

can someone tell me if this directive for apache needs to be inside the  
virtualhost section?

FastcgiIpcDir /tmp/fcgi\_ipc/ #AddHandler fastcgi-script .fcgi FastCgiServer /path/to/rails/root/public/dispatch.fcgi -initial-env RAILS\_ENV=production -processes 3 -idle-timeout 120

I’m trying to run another version of my app in a staging subdomain for  
development purposes. If i move this directive (mod\_fastcgi.c) inside  
the  
 tag, and add this directive inside the virtualhost for my  
subdomain (pointing to its own dispatch.fcgi) will this work?

Is this recommended? Tearing my hair out, please help…

---

<div class="post-metadata">

**Author:** ![mshah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@mshah](https://www.ruby-forum.com/u/mshah)\
**Post date:** [April 26, 2006, 10:49am UTC](https://www.ruby-forum.com/t/application-failed-to-start-for-subdomain/58810/3 "2006-04-26T10:49:01Z")

</div>

Manish S. wrote:

> can someone tell me if this directive for apache needs to be inside the  
> virtualhost section?
> 
> FastcgiIpcDir /tmp/fcgi\_ipc/ #AddHandler fastcgi-script .fcgi FastCgiServer /path/to/rails/root/public/dispatch.fcgi -initial-env RAILS\_ENV=production -processes 3 -idle-timeout 120
> 
> I’m trying to run another version of my app in a staging subdomain for  
> development purposes. If i move this directive (mod\_fastcgi.c) inside  
> the  
> tag, and add this directive inside the virtualhost for my  
> subdomain (pointing to its own dispatch.fcgi) will this work?
> 
> Is this recommended? Tearing my hair out, please help…

Yes, it needs to be inside the vhost, and you’ll need to uncomment the  
AddHandler section. I’m sorry I’m a little vague on this, I use  
Apache2.0 and have separate subdirs and config files for separate sites.

I suspect you may need to start the fcgis from different locations as  
well (though again, I’m sketchy). Apache may be clever enough to work  
out which pids belong to which vhost, but perhaps not.

I’d go with:

/path/to/prodcopyofrails/root/public/dispatch.fcgi

and:

/path/to/stagingcopyofrails/root/public/dispatch.fcgi

Just in case.

Alan
