require "cgi"
cgi = CGI.new()
print cgi.header("content"=>"text/html")
Dr. Ephemeron
"Robert McKinnon" <rob_m_mckinnon / yahoo.com> wrote in message
news:20040306061654.25970.qmail / web13503.mail.yahoo.com...
> 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" <me / privacy.net> 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
>
>