require 'phi' require 'web' module Web MODULE = Module.new APPLICATION PRODUCER = PageProducer.new MODULE end load 'web_init.rb'と等価です。
$(Apollo)\bin\apache にあります。これを $(Apache)\modules フォルダに置きます。
conf/http.conf の最後に以下の設定行を追加します。
LoadModule Apollo_module modules/Apollo.so <Location /Apollo> SetHandler apollo-handler </Location>
ScriptAlias /cgi-bin/ "D:/Apache/cgi-bin/"
<Directory "D:/Apache/cgi-bin">
AllowOverride Options
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script cgi
D:\Apache>Apache -tでモジュールの起動を試しましょう。
D:\Apache>Apacheで起動できます。終了は Ctrl+C です。モジュールを使っていると終了時に待たされます。
$(Apollo)\htdocs に置かれた HTML ファイルを読み込み、 Ruby スクリプトを評価します。
http://localhost/Apollo/foo/bar
$(Apollo)\htdocs\foo\bar.html が存在すればこれを読み込み、(Web::PRODUCER.htmlfile)
$(Apollo)\htdocs\foo\bar.rb が存在すればこれを評価します。(load)
require)
require)
require)
require)
load)
open)
$(Apollo)\htdocs\index.html
<#tagname key=value> を使えます。
$(Apollo)\htdocs\index.rb