[moving to modruby / modruby.net]

> > see mod_ruby Documents
> >  http://www.modruby.net/doc/index.en.html
> > and
> >  apache/ruby-run.rb , apache/eruby-run.rb
> > 
> > > Where is 'Apache::MyAppRun.instance' defined?
> > > The only thing I see defined is 'MyApp#handler'.
> > 
> > I'm sorry, it is my mistake.
> > 
> > -    RubyHandler Apache::MyAppRun.instance
> > +    RubyHandler Apache::MyApp.instance
> > 
> > # My English is weak. I do not want to use English not much.
> > # I am good at Japanese.
> > 
> 
> Ok, first things first. I have created the following tree
> from my website:
> 
>   main_site
>      + htdocs
>          timetest.rhtml
>      + ruby
>          rubyapp.rb

Move this into your site_ruby path, not into the document root.

> I have the following in my http.conf file:
> 
>   <IfModule mod_ruby.c>
>   RubyRequire apache/ruby-run
>   RubyRequire apache/eruby-run
>   RubyRequire apache/preload_timetest.rb
> # this does   ^^^^^^^^^^^^^^^^^^^^^^^^^^
> # not look right

I wouldn't worry about this.

>   <Location /ruby>
>     SetHandler ruby-object
>     RubyHandler Apache::RubyRun.instance
>     RubyHandler Apache::MyApp.instance
>   </Location>

Change the above to (I think you can trim it down to the following if
you write the module correctly):

  <Location /myapp>
    RubyHandler Apache::MyApp
  </Location>

> From a web browser the following works:
> 
>   mysite/timtest.rhtml
> 
> The following does NOT work:
> 
>   mysite/preload_timetest.rb

.rb files aren't associated with mod_ruby.  Try changing it to a .rbx
file and I think you'll see some better results.

> Am I right to think that a preloaded ruby script needs to be in the
> RUBYLIB/apache path and not in the mysite/ruby directory?

Yes.

> If so, then what does the location directive above have to do with
> setting up a preloaded ruby script?

Do you really need to preload your script?  I'd recommend running the
benchmark a total of 4 times.

1st time:   run the benchmark, then throw away the data
2-4th time: run the benchmark, avg the times.

-sc

-- 
Sean Chittenden