From: zhoujing@... (TOTO) Date: 2003-02-22T16:25:03+09:00 Subject: Re: Problem in using RAA - Ruby Application Archive Josef 'Jupp' Schugt wrote in message news:... > On 20 Feb 2003 07:53:02 -0800, > TOTO wrote: > > > I am using RH Linux. I try to unpack the raa package to my public_html > > directory and set the apache configuration properly. However, none of > > the *.rhtml files run properly. All of them give an "Internal server > > error". But when I run a simple test file in the same directory, it > > works. > > > > What possibly cause the problem? > > Three common cases why problems of the above type can arise: > > The most common problem is line ends that follow a convention that > differs from the one used on the server. This can be checked by > looking at the file in vim (bottom line indicates if it is a 'DOS' > file). > > Second problem is access rights: Scripts of any kind can only be run > in the same way as ordinary binaries if they are executable AND > readable (for binaries execute access is sufficient). > > Third problem is accessability: Scripts to be run by Apache must be > accessible to the user Apache is running under. > > I am pretty sure you are facing the first problem. To fix that you > can open the file in vim, type ':set filtype=unix' and save the file > That automagically converts the line ends to Unix convention. > > For batch conversion you may consider 'recode'. > > HTH > > Josef 'Jupp' Schugt Thanks for your reply. But I don't think those are the reasons, since I have tried them all, yet it still didn't work. Please let me give a better description of what I have don't before: 1. Download the raa package and unzip it in my home directory. 2. /home/Frodo/raa/tool/install_www.rb /home/Frodo/public_html/eruby/ install succeed! When I type http://localhost/~Frodo/eruby/entry.rhtml in my browser, there was an Internal Server Error. However, if I tried a simpler rhtml file, that is: http://localhost/~Frodo/eruby/test.rhtml It worked! Here is the content of test.rhtml: eruby example

Enumeration

    <%(1..10).each do|i|%>
  • number <%=i%>
  • <%end%>

Environment variables

<%ENV.keys.sort.each do |key|%> <%end%>
<%=key%><%=ENV[key]%>
Here is my apache-2.0.43 configuration for ruby: # If the ruby module is installed, this will be enabled. # for Apache::RubyRun RubyRequire apache/ruby-run # exec files under /ruby as ruby scripts. SetHandler ruby-object RubyHandler Apache::RubyRun.instance Options ExecCGI # exec *.rbx as ruby scripts. SetHandler ruby-object RubyHandler Apache::RubyRun.instance # for Apache::ERubyRun RubyRequire apache/eruby-run # handle files under /eruby as eRuby files by eruby. SetHandler ruby-object RubyHandler Apache::ERubyRun.instance Options ExecCGI # handle *.rhtml as eruby files. SetHandler ruby-object RubyHandler Apache::ERubyRun.instance # for Apache::ERbRun RubyRequire apache/erb-run # for debug RubyRequire auto-reload Thanks a lot!