Apache + FastCGI + RoR

First question:

FastCgiServer /users/foo/rails/public/dispatch.fcgi -initial-env
RAILS_ENV=production
Do I need define this for every vhost,
or just only one in httpd.conf?
If I need to define it once, what should be the path?
I am confused as I have dispatch.fcgi in each of the public direcotry
of my vhosts.

Second question:

Can I run 2 of my vost in development envionment, 1 in test envionment
and another 2 in production environment?
If so, how?

Thanks,

Mohammad K. wrote:

Second question:

Can I run 2 of my vost in development envionment, 1 in test envionment
and another 2 in production environment?
If so, how?

Thanks,

You might have better results posting this to the Rails mailing list at
http://lists.rubyonrails.org/mailman/listinfo. Ditto for your dupe
message.

sorry for the dupe…
it was a mistake… i didn’t realize gmail really accepted my first
message.

Como’n guys,
Say something !!

Mohammad K. wrote:

Como’n guys,
Say something !!

You’ll get the fastest, best answers on the Rails mailing list:

http://lists.rubyonrails.org/mailman/listinfo/rails

James

you cant put FastCGI directives in the VHOST. You have to set options
globally i believe. if you have multiple rails vhosts do something
like the following globally:

FastCgiIpcDir logs/fcgi AddHandler fastcgi-script .fcgi FastCgiConfig -idle-timeout 60 -minProcesses 15

Is that mean, I will have to use same dispatch.fcgi for every vhost
and i will have to use same envinment for every vhost?

Please correct me, if I am wrong.

Thanks,

Mohammad K. wrote:

Is that mean, I will have to use same dispatch.fcgi for every vhost
and i will have to use same envinment for every vhost?

Please correct me, if I am wrong.

According to Scott L.'s blog:

you should have a FastCgiServer line for each application.

See comments 2 and 8 on the article, and Scott’s responses.

Example (from comment 2)

FastCgiServer /rails_app_1/dispatch.fcgi
-idle-timeout 120
-initial-env RAILS_ENV=production
-processes 10

FastCgiServer /rails_app_2/dispatch.fcgi
-idle-timeout 120
-initial-env RAILS_ENV=production
-processes 10

(note that the numbers of statically allocated processes here are high -
Scott says 2 should be fine unless you are dealing with heavy traffic)

regards

Justin

Thanks a lot everybody for your help.

Mohammad

Mohammad K. wrote:

Thanks a lot everybody for your help.

Please tell us what works for you - your question was a good one.

regards

Justin