Hi,
In message <AC803256-DAED-11D7-B360-000393876156@cox.net>,
`Mark Wilson <mwilson13@cox.net>' wrote:
> I'll show code and output to describe the problem I'm having. I'm aware
> that my problem may be with web servers generally and not webrick
> specifically, but I still need help.
CGIHandler is invoked by FileHandler. When FileHander was
connected to a directory by HTTPServer#mount, the files on
the directory will be processed by handler accorded with the
file type.
If you want to process every file under specified directory
by CGIHandler, :HandlerTable option (for FileHandler) can be
used.
require 'webrick'
include WEBrick
docroot = File::join(Dir::pwd, "htdocs")
cgibin = File::join(docroot, "cgi-bin")
s = HTTPServer.new(:Port => 2000, :DocumentRoot => docroot)
# :HandlerTable is a Hash to take a handler appropriate to
# suffix of file. (For /cgi-bin directory, use CGIHandler
# as default.)
file_handler_opt = { :HandlerTable => Hash.new(HTTPServlet::CGIHandler) }
s.mount("/cgi-bin", HTTPServlet::FileHandler, cgibin, file_handler_opt)
trap("INT") { s.shutdown }
s.start
--
gotoyuzo