mod_ruby and Apache ForceType

Discussion in 'Ruby' started by George Moschovitis, Jun 22, 2004.

  1. Hello everyone,

    I am trying to use the ForceType directive of apache
    to get more readable urls, like this php based example:

    <Files *>
    ForceType application/x-httpd-php
    </Files>

    Does anyone know what is the equivalent of
    application/x-httpd-php for mod_ruby?

    I tried the following but failed:

    AddType application/x-httpd-ruby .sx
    AddHandler ruby-object .sx
    <Files *>
    ForceType application/x-httpd-ruby
    </Files>

    Any help will be really appreciated!

    George Moschovitis
     
    George Moschovitis, Jun 22, 2004
    #1
    1. Advertising

  2. One other approach that I've used is to use mod_rewrite to cause some
    scripts to be interpreted as ruby scripts. In this case I am causing
    certain URLS to be transparently redirected to a fastcgi script that
    happens to be a ruby script:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteLog logs/rewrite_log
    RewriteLogLevel 0

    # don't use controller to process requests for static files
    RewriteCond %{REQUEST_URI} .*\.(gif|jpg|png|css|js)$
    RewriteRule .* - [L]

    # send all other requests into the controller ruby script
    RewriteRule ^.*$ /controller.fcgi [L,T=fastcgi-script]
    </IfModule>

    On Tue, 22 Jun 2004 20:28:12 +0900, George Moschovitis <> wrote:
    >
    > Hello everyone,
    >
    > I am trying to use the ForceType directive of apache
    > to get more readable urls, like this php based example:
    >
    > <Files *>
    > ForceType application/x-httpd-php
    > </Files>
    >
    > Does anyone know what is the equivalent of
    > application/x-httpd-php for mod_ruby?
    >
    > I tried the following but failed:
    >
    > AddType application/x-httpd-ruby .sx
    > AddHandler ruby-object .sx
    > <Files *>
    > ForceType application/x-httpd-ruby
    > </Files>
    >
    > Any help will be really appreciated!
    >
    > George Moschovitis
     
    Carl Youngblood, Jun 22, 2004
    #2
    1. Advertising

  3. George Moschovitis

    Dick Davies Guest

    Can't answer directly , but isn't this the same as

    <Files *>
    SetHandler ruby-object
    RubyHandler Apache::ERubyRun.instance
    </Files>

    (for eruby)

    or
    <Files *>
    Options +ExecCGI
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    </Files>

    (for ruby cgi type scripts)


    I'd replace the <Files> above with a <FilesMatch> to
    exclude images etc.

    * George Moschovitis <> [0631 12:31]:
    > Hello everyone,
    >
    > I am trying to use the ForceType directive of apache
    > to get more readable urls, like this php based example:
    >
    > <Files *>
    > ForceType application/x-httpd-php
    > </Files>
    >
    > Does anyone know what is the equivalent of
    > application/x-httpd-php for mod_ruby?
    >
    > I tried the following but failed:
    >
    > AddType application/x-httpd-ruby .sx
    > AddHandler ruby-object .sx
    > <Files *>
    > ForceType application/x-httpd-ruby
    > </Files>
    >
    > Any help will be really appreciated!
    >
    > George Moschovitis
    >
    >


    --
    Mosher's Law of Software Engineering:
    Don't worry if it doesn't work right. If everything did, you'd
    be out of a job.
    Rasputin :: Jack of All Trades - Master of Nuns
     
    Dick Davies, Jun 23, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Heinemeier Hansson

    Memory consumption of Ruby/mod_ruby combo on Apache

    David Heinemeier Hansson, Sep 9, 2003, in forum: Ruby
    Replies:
    3
    Views:
    111
    Fritz Heinrichmeyer
    Sep 10, 2003
  2. David Heinemeier Hansson
    Replies:
    0
    Views:
    114
    David Heinemeier Hansson
    Feb 13, 2004
  3. Robert McKinnon
    Replies:
    1
    Views:
    201
    Dave Thomas
    Mar 6, 2004
  4. Victor Reyes
    Replies:
    5
    Views:
    119
    Victor Reyes
    Sep 15, 2004
  5. Johny Goerend
    Replies:
    3
    Views:
    209
    Brian Candler
    Sep 27, 2010
Loading...

Share This Page