# Apache and eruby

**URL:** <https://www.ruby-forum.com/t/apache-and-eruby/84832>\
**Category:** Ruby\
**Created:** [December 31, 2005, 12:30pm UTC](https://www.ruby-forum.com/t/apache-and-eruby/84832 "2005-12-31T12:30:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 31, 2005, 12:30pm UTC](https://www.ruby-forum.com/t/apache-and-eruby/84832/1 "2005-12-31T12:30:20Z")

</div>

i’d like to use eruby with mod\_ruby

i’ve installed bothe of them and add some config to Apache (see below)

i’ve tested my config within folder /path/to/www/ruby  
with a cgi script named “test” , works ok

and also within folder /path/to/www  
with the same cgi script named “test.rbx” =\> works well !

then, i want to test an “index.rhtml” file within /path/to/www  
no error message, however the navigator (FireFox) want me to download  
the file “index.rhtml” instead of visualizing it !

what did i miss here ?  
a special configuration of mod\_ruby to allow eruby ?

LoadModule ruby\_module /usr/libexec/httpd/mod\_ruby.so

\<IfDefine !APACHE2\>  
AddModule mod\_ruby.c

 RubyRequire apache/ruby-run
# Excute files under /ruby as Ruby scripts

\<Directory /Users/yvon/Sites/ruby\>  
Options ExecCGI  
SetHandler ruby-object  
RubyHandler Apache::RubyRun.instance

# Execute \*.rbx files as Ruby scripts

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

 RubyRequire apache/eruby-run

AddType application/x-httpd-eruby .rhtml  
Action application/x-httpd-eruby eruby

 DirectoryIndex index.rhtml 
# Handle \*.rhtml files as eRuby files

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

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 31, 2005, 12:57pm UTC](https://www.ruby-forum.com/t/apache-and-eruby/84832/2 "2005-12-31T12:57:37Z")

</div>

Une bévue [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> then, i want to test an “index.rhtml” file within /path/to/www  
> no error message, however the navigator (FireFox) want me to download  
> the file “index.rhtml” instead of visualizing it !

i had to comment the lines :

# AddType application/x-httpd-eruby .rhtml

# Action application/x-httpd-eruby eruby
