rublog and mod_ruby (was: mod_ruby & Apache)

Discussion in 'Ruby' started by Robert McKinnon, Mar 6, 2004.

  1. I have a similar difficulty trying to run rublog with mod_ruby on
    Apache.

    Apache is not using the Content-type field from the rublog output,
    instead it adds its own with type text/plain. So the web browser thinks
    it is receiving plain text. I used a proxy server to see the HTTP
    Response, it looks like:
    HTTP/1.1 200 OK
    Date: Sat, 06 Mar 2004 05:56:14 GMT
    Server: Apache/2.0.48 (Fedora)
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/plain; charset=UTF-8

    1c3b

    Content-type: text/html
    Last-modified: Thu, 01 Jan 1970 00:00:00 GMT

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    ...


    My setup:
    ruby 1.8.1 (2004-02-28)
    httpd 2.0.48-1.2
    mod_ruby 1.1.2
    rublog lastest CVS version[1]


    My httpd.conf:
    <IfModule mod_ruby.c>
    RubyRequire apache/ruby-run

    <Files *.rbx>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    RubyAddPath /home/aaa/apps/rublog/rublog
    Options ExecCGI
    </Files>
    </IfModule>

    Alias /blog "/home/aaa/docs/blog/cgi/rublog.rbx"


    For now I'll go back to running rublog as a cgi script.

    Regards,
    Rob

    [1] To prevent a security error when running rublog I had to change
    line 168 of FileEntries.rb from:
    Dir.glob(File.join(entry_dir.full_name, "*")).each do |filename|
    to:
    file_pattern = File.join(entry_dir.full_name, "*")
    file_pattern.untaint
    Dir.glob(file_pattern).each do |filename|


    --- "Dr. Ephemeron" <> wrote:
    > Sorry, if this seems like a simple problem, but I have:
    >
    > Mandrake 9.2
    > Apache 2.0.47
    > mod_ruby 1.0.7
    > eruby 1.0.5
    >
    > mod_ruby is reported installed by Apache and I can make a test
    > *.rhtml file
    > in my html directory and it works fine.
    >
    > When put a *.rbx file in my cgi-bin directory and browse it with
    > Mozilla
    > 1.4, it prints, but it prints everything in the file like this:
    >
    > HTTP/1.1 200 OK
    > Content-type: text/html
    >
    > <!DOCTYPE HTML PUBLIC ...
    > <html>
    > <head>
    > .
    > .
    > .
    >
    > It looks to me like it is probably an Apache setting that needs to be
    > changed, but I can't figure out which one. I am new to all of this
    > and
    > struggling just to get it operational so I can learn more.
    >
    > Thanks


    __________________________________
    Do you Yahoo!?
    Yahoo! Search - Find what you’re looking for faster
    http://search.yahoo.com
     
    Robert McKinnon, Mar 6, 2004
    #1
    1. Advertising

  2. Robert McKinnon

    Dave Thomas Guest

    On Mar 6, 2004, at 0:16, Robert McKinnon wrote:

    > Apache is not using the Content-type field from the rublog output,
    > instead it adds its own with type text/plain. So the web browser thinks
    > it is receiving plain text. I used a proxy server to see the HTTP


    If you come up with a solution for this, please send me a patch and
    I'll integrate it in.


    Cheers

    Dave
     
    Dave Thomas, Mar 6, 2004
    #2
    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. Brian McCallister

    Rublog Problems

    Brian McCallister, Oct 30, 2003, in forum: Ruby
    Replies:
    3
    Views:
    131
    Eric Stewart
    Nov 1, 2003
  2. Hal Fulton

    Rublog questions

    Hal Fulton, Jan 3, 2004, in forum: Ruby
    Replies:
    5
    Views:
    118
    Dave Thomas
    Jan 4, 2004
  3. Dave Thomas

    RubLog has moved

    Dave Thomas, Apr 18, 2004, in forum: Ruby
    Replies:
    0
    Views:
    109
    Dave Thomas
    Apr 18, 2004
  4. Lipper, Matthew

    Inlining Images Using Rublog

    Lipper, Matthew, Jul 27, 2004, in forum: Ruby
    Replies:
    1
    Views:
    135
    Dave Thomas
    Jul 27, 2004
  5. Bill Atkins

    Getting Rublog

    Bill Atkins, Aug 8, 2004, in forum: Ruby
    Replies:
    2
    Views:
    111
    Tom Copeland
    Aug 9, 2004
Loading...

Share This Page