X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=examples%2Fcgi-webrick.rb;h=5554a012ba859fb88d180792230c548084b27784;hb=21fcd8a37c82c1ef654d402cf592f0c9d803aa26;hp=1bc690f1fbb7f7f7a6225ccb6fa02f502d4c550e;hpb=ae1c27f9ff9b38ba038b7cc6a19e1d9bc2cee714;p=public-inbox.git diff --git a/examples/cgi-webrick.rb b/examples/cgi-webrick.rb index 1bc690f1..5554a012 100644 --- a/examples/cgi-webrick.rb +++ b/examples/cgi-webrick.rb @@ -1,10 +1,16 @@ #!/usr/bin/env ruby +# Sample configuration using WEBrick, mainly intended dev/testing +# for folks familiar with Ruby and not various Perl webserver +# deployment options. For those familiar with Perl web servers, +# plackup(1) is recommended for development and public-inbox-httpd(1) +# is our production deployment server. require 'webrick' require 'logger' options = { :BindAddress => '127.0.0.1', :Port => 8080, :Logger => Logger.new($stderr), + :CGIPathEnv => ENV['PATH'], # need to run 'git' commands :AccessLog => [ [ Logger.new($stdout), WEBrick::AccessLog::COMBINED_LOG_FORMAT ] ], @@ -12,8 +18,8 @@ options = { server = WEBrick::HTTPServer.new(options) server.mount("/", WEBrick::HTTPServlet::CGIHandler, - "#{Dir.pwd}/blib/script/public-inbox.cgi") + "/var/www/cgi-bin/public-inbox.cgi") ['INT', 'TERM'].each do |signal| - trap(signal) {exit} + trap(signal) {exit!(0)} end server.start