Install mod in Apache

xiaoxiao2021-03-06  81

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 RubyRequire apache / ruby-run # Excucute files under / ruby ​​as Ruby scripts SetHandler ruby-object RubyHandler Apache :: RubyRun.instance Options ExecCGI # Execute * .rb files as Ruby scripts SetHandler ruby-object RubyHandler Apache :: RubyRun.instance RubyRequire apache / eruby-run #Handle files under / eruby as eRuby files SetHandler ruby-object RubyHandler Apache :: ERubyRun.instance # Handle * .rhtml files as Eruby Files setHandler Ruby-Object RubyHandler Apache :: Erubyrun.instance then build a file TEST.RHTML in the web root directory,

The content is:

Hello <% = "world"%>

Then open /test.rhtml in your browser, if everything is normal, you should appear: Hello World.

转载请注明原文地址:https://www.9cbs.com/read-92491.html

New Post(0)