From: Sean Chittenden Date: 2002-04-12T04:00:52+09:00 Subject: Re: Switching from PHP to Ruby - Comments Please [these discussions probably belong on the modruby@modruby.net list instead] > I am updating the httpd.conf file, but have a few questions about > the extent of the options. When I install php, I don't need near the > amount of config options. PHP puts the work into the ./configure line. :~) > # If the ruby module is installed, this will be enabled. > 10 > 11 # for Apache::RubyRun > 12 RubyRequire apache/ruby-run This tells Apache to preload the ruby-run module and "compile" the module at startup (or as much of a compile time as ruby has). > 14 # exec files under /ruby as ruby scripts. > => What is exec files for. Is this equivalent to cgi-bin folder? > 15 > 16 SetHandler ruby-object > 17 RubyHandler Apache::RubyRun.instance > 18 Options ExecCGI > 19 > 20 > => What is this? Specifying file extension inside /ruby? More or less, yes. It says that all files who's URI is starts with "/ruby" will be passed to the Apache::RubyRun response handler (ie, be executed as a mod_ruby script. This applies to _all_ files, not just files that end in .rbx. > 21 # exec *.rbx as ruby scripts. > 22 > 23 SetHandler ruby-object > 24 RubyHandler Apache::RubyRun.instance > 25 Like the tag above, this tells Apache to pass all files that end in .rbx to Apache::RubyRun. This applies to all files through out the server. You can move this section into specific virtual hosts if you'd like (what I frequently do). > 27 # # for Apache::ERubyRun > 28 # RubyRequire apache/eruby-run > 29 # > 30 # # handle files under /eruby as eRuby files by eruby. > 31 # > 32 # SetHandler ruby-object > 33 # RubyHandler Apache::ERubyRun.instance > => What is the ExecCGI for? > 34 # Options ExecCGI > 35 # > 36 # Hmm... the ExecCGI is used for (I want to say legacy), but is used to regulate whether or not you can execute a script or not. Actually, with the above directive, you'd want an Options +ExecCGI as well. It's a way of allowing for finer grained control for telling Apache whether or not it should execute a script. I have mixed feelings on the directive and generally just turn it on server wide, but circumstances may dictate otherwise. > => So all .rthml files are parsed by eruby? > 37 # # handle *.rhtml as eruby files. > 38 # > 39 # SetHandler ruby-object > 40 # RubyHandler Apache::ERubyRun.instance > 41 # The will be once you uncomment those lines. ;~) > 43 # # for Apache::ERbRun > 44 # RubyRequire apache/erb-run > 45 # > 46 # # handle files under /erb as eRuby files by ERb. > 47 # > 48 # SetHandler ruby-object > 49 # RubyHandler Apache::ERbRun.instance > 50 # Options ExecCGI > 51 # > 52 > 53 # # for debug > 54 # RubyRequire auto-reload > 55 > > Also, PHP has the following > DirectoryIndex index.php index.php3 index.html > > Why does mod ruby not require something like: > DirectoryIndex index.rbx index.rhtml It does actually. Whenever I lay my hands on a server, this is what I toss in regardless of the current set of modules loaded: DirectoryIndex index.rbx index.rhtml index.pl index.php index.html index.cgi DirectoryIndex index.pl index.php index.html index.cgi DirectoryIndex index.rbx index.rhtml index.php index.html index.cgi DirectoryIndex index.php index.html index.cgi DirectoryIndex index.rbx index.rhtml index.pl index.html index.cgi DirectoryIndex index.pl index.html index.cgi DirectoryIndex index.rbx index.rhtml index.html index.cgi DirectoryIndex index.html index.cgi np. -sc -- Sean Chittenden