Problem in using RAA - Ruby Application Archive

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?

Thanks in advance.

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

···

On 20 Feb 2003 07:53:02 -0800, TOTO zhoujing@comp.nus.edu.sg 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?

Josef ‘Jupp’ Schugt jupp@gmx.de wrote in message news:slrnb5cg37.b0c.jupp@jupp.8m.com

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.

<Location /ruby-cgi>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options ExecCGI

exec *.rbx as ruby scripts.

<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance

for Apache::ERubyRun

RubyRequire apache/eruby-run

handle files under /eruby as eRuby files by eruby.

<Location /eruby>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
Options ExecCGI

handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

for Apache::ERbRun

RubyRequire apache/erb-run

for debug

RubyRequire auto-reload

Thanks a lot!

···

On 20 Feb 2003 07:53:02 -0800, > TOTO zhoujing@comp.nus.edu.sg wrote:

TOTO wrote:

When I type http://localhost/~Frodo/eruby/entry.rhtml
in my browser, there was an Internal Server Error.

Do you have access to the webservers error logs?
Location may wary by distribution, I’m mostly used to it being at
/var/log/httpd/error_log
I often run
tail -f /var/log/httpd/error_log
as root while testing, so that I see the error messages in full as they
pop in.

I’d also suggest using…

for Apache::ERubyRun

RubyRequire apache/eruby-run

RubyRequire apache/eruby-debug

handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

  RubyHandler Apache::ERubyDebug.instance

instead, since it will reduce the need for checking the error_log. Then
go back to eruby-run and ERubyRun once things are up and running.

HTH

···


([ Kent Dahl ]/)_ ~ [ http://www.stud.ntnu.no/~kentda/ ]/~
))_student
/(( _d L b_/ NTNU - graduate engineering - 5. year )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)

Kent Dahl kentda@stud.ntnu.no wrote in message news:3E573FC8.1D388DDE@stud.ntnu.no

TOTO wrote:

When I type http://localhost/~Frodo/eruby/entry.rhtml
in my browser, there was an Internal Server Error.

Do you have access to the webservers error logs?
Location may wary by distribution, I’m mostly used to it being at
/var/log/httpd/error_log
I often run
tail -f /var/log/httpd/error_log
as root while testing, so that I see the error messages in full as they
pop in.

I’d also suggest using…

for Apache::ERubyRun

RubyRequire apache/eruby-run

RubyRequire apache/eruby-debug

handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

  RubyHandler Apache::ERubyDebug.instance

instead, since it will reduce the need for checking the error_log. Then
go back to eruby-run and ERubyRun once things are up and running.

HTH

Thanks. That is a very useful hint.