From: Pet Farrari Date: 2006-10-09T16:55:10+09:00 Subject: Re: where to start Thiago Jackiw wrote: > Pet, > > It seems you have a Ruby on Rails web app running on your machine. The > dispatch.fcgi file is, as its name says, a dispatcher for your rails > app and it's handled by your apache's mod_fcgi. > > Hope it helps. > > Thiago > Hi in the same directory as the dispatch.cgi file, I also found a file dispatch.rb a ruby script file. But I don't know how this both dispatch.cgi and dispatch.rb file are related. In the dispatch.cgi file, what command/ruby script does it dispatched? The dispatch.rb file has the following implementation: # less dispatch.rb #!/usr/local/bin/ruby18 require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired require "dispatcher" ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun) Dispatcher.dispatch Thanks S > > On 10/8/06, Pet Farrari wrote: >> Hi, >> >> I found there are some Ruby programs are running in this development >> machines. Now I need to add some functionality into the Ruby program, >> but I don't know where to look into its starting program or its main >> body of the program. >> >> in aparche/httpd.conf file: >> >> >> ## >> ## SSL Virtual Host Context >> ## >> >> FastCgiServer /www/apps/scripts/public/dispatch.fcgi -idle-timeout 90 >> -initial-env RAILS_ENV=production -processes 10 >> >> >> >> >> Here is the dispatch.fcgi script: >> require File.dirname(__FILE__) + "/../config/environment" >> require 'fcgi_handler' >> >> RailsFCGIHandler.process! >> >> I got stuck. I don't know how does this dispatch.fcgi program invoke >> which ruby main program... >> >> Can anyone please shed some light on me? >> >> Thanks >> S >> >> >