I want to use Ruby in Apache through CGI. I have the following in my configuration file:
DocumentRoot /home/ceriak/ruby
<Directory /home/ceriak/ruby>
Options +ExecCGI
AddHandler cgi-script .rb
</Directory>
test.rb
is a testfile placed under /home/ceriak/ruby/
, #!/usr/bin/ruby
included on the first line and given executable permissions. Still, when I visit localhost/test.rb
I get a download window and can obtain the source code.
Interestingly, when I place the same script under /usr/lib/cgi-bin/
and call localhost/cgi-bin/test.rb
it works as supposed.
(Apache2 on Ubuntu 9.10.)
Any idea?