1 Introduction
MOD_RUBY embeds the Ruby interpreter in Apache, which enables Ruby CGI to execute faster.
download link:
http://modruby.net/archive/mod_ruby-1.2.4.tar.gz
Eruby is an implementation of Eruby, which embeds the Ruby code into normal text, such as HTML, so similar ASP, PHP, etc.
download link:
http://modruby.net/archive/eruby-1.0.5.tar.gz
2. Installation
Install Apache: (1.3.29)
./configure --prefix = / usr / local / apache --enable-module = REWRITE --ENABLE-MODULE = SO
Make
Make Install
Install mod_ruby:
CD MOD_RUBY-1.2.4
./configure.rb --with-apxs = / usr / local / apache / bin / apxs
Make
Make Install
Install Eruby
CD Eruby-1.0.5
./configure.rb
Make
Make Install
3. Configuration
Editor /usR/local/apache/conf/httpd.conf
Join the following:
LoadModule ruby_module /usr/local/apache/libexec/mod_ruby.so # ClearModuleList # AddModule mod_ruby.c
The content is:
Hello <% = "world"%>
Then open /test.rhtml in your browser, if everything is normal, you should appear: Hello World.