FOUND was (Re: [ydl-gen] apache 2 and eRuby)

Une bévue yvon.thor at free.fr
Tue Dec 13 13:27:41 MST 2005


On Tue, 13 Dec 2005 10:24:14 +0100
Une bévue <yvon.thor at free.fr> wrote:

> someone did configure apache with eruby successfully ?


in fact, that' easy to do, as usual ;-)

install everything by using yum (ruby and eruby).
$ sudo yum install 'rub*'
$ sudo yum install 'erub*'

copy /usr/bin/eruby to /var/www/cgi-bin

edit /etc/httpd/conf.d/eruby.conf with the following lines :

#
# eRuby is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#


#
# Cause the eRuby interpreter to handle files with a .rhtml extension.
#
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby

#
# Add index.rhtml to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.rhtml


restart httpd by :
$ sudo /etc/init.d/httpd restart

in case you want an auto start of apache 2  at run level 5 enter ;
$ /sbin/chkconfig --level 5 httpd on


put in your web repository, an "HelloWorld.rhtml" like that :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>eruby test</title>
</head>
<body>
<h1>eruby test</h1>
<p>
<% print "hello world" %>
current time: <%= Time.now %>
<%# this is a comment line. %>
% print "this is one liner.\n"
</p>
</body>
</html>

that's all folks ;-)

Une bévue


More information about the yellowdog-general mailing list