Now with Enterprise Linux 5 packages
Ruby 1.8.7-p72 for RHEL4 on an x86 machine.
mod_ruby and eRuby modules built with Apache2.
This quick how to will explain how to install ruby, eruby, mod_ruby with Ensim. These RPMs will work on plain RHEL4 servers without Ensim.
Please note I am not responsible if you break your server because of this how to. Use this information at your own risk. These RPM packages work great on all my boxes.
To install rpm, simply run rpm -ivh file.rpm file2.rpm
Example:
CODE
rpm -ivh ruby-1.8.7.72-1.el4.i386.rpm ruby-libs-1.8.7.72-1.el4.i386.rpm ruby-abi-1.8.7.72-1.el4.i386.rpm
If upgrading, use -Uvh arguments instead.
All rpms are available at:
Enterprise Linux 4:
http://www.amsdi.com/downloads/linux/redhat/el4/ruby
Enterprise Linux 5:
http://www.amsdi.com/downloads/linux/redhat/el5/ruby
Ruby requires: ruby, ruby-libs, ruby-abi
eRuby requires: eruby eruby-libs mod_ruby
Ensim customizations:
Add ruby to each virtual site, do the following:
Edit or create /etc/virtualhosting/filelists/siteinfo.custom.sh
CODE
#!/bin/bash
read
while [ $? == 0 ]; do
echo $REPLY
read
done
echo "N:S,rpm:ruby"
echo "N:S,rpm:ruby-libs"
echo "N:S,rpm:ruby-abi"
echo "N:S,rpm:eruby"
echo "N:S,rpm:eruby-libs"
read
while [ $? == 0 ]; do
echo $REPLY
read
done
echo "N:S,rpm:ruby"
echo "N:S,rpm:ruby-libs"
echo "N:S,rpm:ruby-abi"
echo "N:S,rpm:eruby"
echo "N:S,rpm:eruby-libs"
Run the following in the terminal:
For Ensim 4
CODE
set_pre_maintenance
set_maintenance
set_post_maintenance
set_maintenance
set_post_maintenance
For Ensim X
CODE
/usr/local/sbin/synchronizeFST -S
Then run (Ensim 4 Only):
service webppliance restart
To use mod_ruby, you must edit /etc/httpd/conf.d/ruby.conf
My configuration looks like this:
CODE
LoadModule ruby_module modules/mod_ruby.so
# This will allow execution of mod_perl to compile your scripts to
# subroutines which it will execute directly, avoiding the costly
# compile process for most requests.
RubyRequire apache/ruby-run
Alias /ruby /var/www/ruby
# Execute *.rbx files as Ruby scripts
#
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
# Handle *.rhtml as eruby files
#
<Files *.rhtml>
RubyRequire apache/eruby-run
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
# This will allow execution of mod_perl to compile your scripts to
# subroutines which it will execute directly, avoiding the costly
# compile process for most requests.
RubyRequire apache/ruby-run
Alias /ruby /var/www/ruby
# Execute *.rbx files as Ruby scripts
#
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
# Handle *.rhtml as eruby files
#
<Files *.rhtml>
RubyRequire apache/eruby-run
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
Restart apache
CODE
/etc/rc.d/init.d/httpd restart
For ruby on rails, see this post: http://forums.theplanet.com/index.php?show...st&p=568044
Enjoy!
