Forum: Ruby on Rails application failed to start for subdomain

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F10f95926f620318a71c102f207649b7?d=identicon&s=25 Manish Shah (Guest)
on 2006-04-26 04:33
(Received via mailing list)
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, 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.
F10f95926f620318a71c102f207649b7?d=identicon&s=25 Manish Shah (Guest)
on 2006-04-26 07:55
(Received via mailing list)
can someone tell me if this directive for apache needs to be inside the
virtualhost section?

<IfModule mod_fastcgi.c>
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
</IfModule>

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
<VirtualHost> 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...
4daf0b71d5d9a3882e583c0e72eaf5dc?d=identicon&s=25 Alan Francis (Guest)
on 2006-04-26 10:49
Manish Shah wrote:
> can someone tell me if this directive for apache needs to be inside the
> virtualhost section?
>
> <IfModule mod_fastcgi.c>
> 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
> </IfModule>
>
> 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
> <VirtualHost> 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
This topic is locked and can not be replied to.