Apache + FastCGI + RoR


#1

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,


#2

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.


#3

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


#4

Como’n guys,
Say something !!


#5

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


#6

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

#7

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,


#8

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:
http://scottstuff.net/blog/articles/2005/07/20/apache-tuning-for-rails-and-fastcgi
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

#9

Thanks a lot everybody for your help.

Mohammad


#10

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