Mercurial > hg > soundsoftware-site
comparison public/dispatch.fcgi.example @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | 513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
1 #!/usr/bin/env ruby | 1 #!/usr/bin/env ruby |
2 # | |
3 # You may specify the path to the FastCGI crash log (a log of unhandled | |
4 # exceptions which forced the FastCGI instance to exit, great for debugging) | |
5 # and the number of requests to process before running garbage collection. | |
6 # | |
7 # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log | |
8 # and the GC period is nil (turned off). A reasonable number of requests | |
9 # could range from 10-100 depending on the memory footprint of your app. | |
10 # | |
11 # Example: | |
12 # # Default log path, normal GC behavior. | |
13 # RailsFCGIHandler.process! | |
14 # | |
15 # # Default log path, 50 requests between GC. | |
16 # RailsFCGIHandler.process! nil, 50 | |
17 # | |
18 # # Custom log path, normal GC behavior. | |
19 # RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' | |
20 # | |
21 require File.dirname(__FILE__) + "/../config/environment" | |
22 require 'fcgi_handler' | |
23 | 2 |
24 RailsFCGIHandler.process! | 3 require File.dirname(__FILE__) + '/../config/boot' |
4 require File.dirname(__FILE__) + '/../config/environment' | |
5 | |
6 class Rack::PathInfoRewriter | |
7 def initialize(app) | |
8 @app = app | |
9 end | |
10 | |
11 def call(env) | |
12 env.delete('SCRIPT_NAME') | |
13 parts = env['REQUEST_URI'].split('?') | |
14 env['PATH_INFO'] = parts[0] | |
15 env['QUERY_STRING'] = parts[1].to_s | |
16 @app.call(env) | |
17 end | |
18 end | |
19 | |
20 Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(RedmineApp::Application) |