rublog and mod_ruby (was: mod_ruby & Apache)

  • Thread starter Robert McKinnon
  • Start date
R

Robert McKinnon

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 said:
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
 
D

Dave Thomas

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top