From: Alan Chen Date: 2002-04-12T02:06:29+09:00 Subject: Re: Switching from PHP to Ruby - Comments Please On Thu, Apr 11, 2002 at 11:49:58AM +0900, Jim Freeze wrote: > Sean: > > I have installed mod_ruby and eruby. > 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. > > # If the ruby module is installed, this will be enabled. yes > 10 > => What is exec files for. Is this equivalent to cgi-bin folder? yes, otherwise apache won't execute the files under /ruby and will just show the file as a text file. This is optional, you can just as easily place your ruby files under the cgi-bin directory with a string like: #!/usr/bin/ruby or #!/usr/bin/env ruby If they don't end an an .rbx as specified later, they won't be loaded under mod_ruby. > 15 > 16 SetHandler ruby-object > 17 RubyHandler Apache::RubyRun.instance > 18 Options ExecCGI > 19 > 20 > => What is this? Specifying file extension inside /ruby? yes. docroot/ruby (where docroot is probably defined earlier in your httpd.conf file) on my debian system docroot defaults to /var/www so /var/www/ruby > 21 # exec *.rbx as ruby scripts. > 22 > 23 SetHandler ruby-object > 24 RubyHandler Apache::RubyRun.instance > 25 > 26 > 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? This runs eruby against the files found in the docroot/eruby directory Again, if you prefer, you can place the eruby files in the cgi-bin this time invoking them with a first line of #!/usr/bin/eruby > 34 # Options ExecCGI > => So all .rthml files are parsed by eruby? yes. > 37 # # handle *.rhtml as eruby files. > 38 # > 39 # SetHandler ruby-object > 40 # RubyHandler Apache::ERubyRun.instance > 41 # > 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 You can do this if you want apache to treat those files as index.html files. It works fine, I did it on my system. Maybe we should recommend the mod_ruby ship its example httpd.conf with that line documented and commented out. -- Alan Chen Digikata LLC http://digikata.com