Sha256: 6d24ba0c487bae91520e4827364c07bd40a92a53a8bbb8f9ec6a27cae9dc3c48

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI


# Remember to set RubySafeLevel 0 in httpd.conf
<IfModule mod_ruby.c>
  RubyRequire apache/ruby-run
  <Files dispatch.rb>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
  </Files>
</IfModule>


# Make sure that mod_ruby.c has been added and loaded as a module with Apache
RewriteEngine On

RewriteRule ^dispatch.servlet$ / [R]

# Enable this rewrite rule to point to the controller/action that should serve root.
# RewriteRule ^$ /controller/action [R]

# Force fcgi
RewriteRule ^fcgi/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.fcgi?controller=$1&action=$2&id=$3 [QSA] [L]
RewriteRule ^fcgi/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.fcgi?controller=$1&action=$2 [QSA] [L]
RewriteRule ^fcgi/([-_a-zA-Z0-9]+)/?$ /dispatch.fcgi?controller=$1&action=index [QSA] [L]

# Force mod_ruby
RewriteRule ^mruby/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.rb?controller=$1&action=$2&id=$3 [QSA] [L]
RewriteRule ^mruby/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.rb?controller=$1&action=$2 [QSA] [L]
RewriteRule ^mruby/([-_a-zA-Z0-9]+)/?$ /dispatch.rb?controller=$1&action=index [QSA] [L]

# Default rewriting rules. Change extension from .cgi to .fcgi to switch to FCGI and to .rb to switch to mod_ruby
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.cgi?controller=$1&action=$2&id=$3 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ /dispatch.cgi?controller=$1&action=$2 [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)/$ /dispatch.cgi?controller=$1&action=index [QSA] [L]
RewriteRule ^([-_a-zA-Z0-9]+)$ /$1/ [R]


# You can also point these error messages to a controller/action
ErrorDocument 500 /500.html
ErrorDocument 404 /404.html

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-0.8.5 configs/apache.conf
rails-0.8.0 configs/apache.conf