# Does NOT work
FastCGIserver {
FastCGIid = redmine
ConnectTo = 127.0.0.1:2010
Extension = fcgi, *
}
FastCGIserver {
FastCGIid = redmine
ConnectTo = 127.0.0.1:2010
}
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
Binding {
Port = 80
}
Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha
StartFile = index.html
AccessLogfile = /var/www/hiawatha/access.log
ErrorLogfile = /var/www/hiawatha/error.log
## This is the interesting part:
FastCGIserver {
FastCGIid = redmineFcgi
ConnectTo = 127.0.0.1:2010
Extension = fcgi
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI exists Return
Match ^(.*)$ Rewrite /dispatch.fcgi
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/public
StartFile = dispatch.fcgi
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
FastCGI = redmineFcgi
UseToolkit = redmineTk
}
ENV['RAILS_ENV'] ||= 'production' ## <<--- the only thing I've added is this line
RAILS_GEM_VERSION = '2.1.1' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
begin
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
rescue LoadError
end
Rails::Initializer.run do |config|
config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
config.action_controller.session_store = Store
config.active_record.observers = :message_observer
config.action_mailer.perform_deliveries = false
end
cgi-fcgi -start -connect :2010 /root/works/redmine/public/dispatch.fcgi 3
FastCGIserver {
FastCGIid = redmineFcgi
ConnectTo = 127.0.0.1:2010
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI exists Return
Match .* FastCGI redmineFcgi
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
}
10.0.0.41|Thu 27 Nov 2008 00:25:49 +0200|404|0||GET / HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.5|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive
10.0.0.41|Thu 27 Nov 2008 00:25:53 +0200|404|0||GET /login HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.5|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive|If-None-Match: "74176006405f83840bb884c13296b9d1"
vmdebian:~/works/redmine# ./script/server -e production -p 80
=> Booting WEBrick...
=> Rails 2.1.1 application started on http://0.0.0.0:80
=> Ctrl-C to shutdown server; call with --help for options
[2008-11-27 00:50:39] INFO WEBrick 1.3.1
[2008-11-27 00:50:39] INFO ruby 1.8.5 (2006-08-25) [i486-linux]
[2008-11-27 00:50:39] INFO WEBrick::HTTPServer#start: pid=2731 port=80
10.48.52.41 - - [27/Nov/2008:00:51:03 EET] "GET /wiki/bt-records HTTP/1.1" 404 3257
http://redmine.lan/projects/show/bt-records -> /wiki/bt-records
if (session->uri_is_dir) {
strcpy(session->file_on_disk + length, session->host->start_file);
} else {
return 404;
}
if (session->uri_is_dir) {
strcpy(session->file_on_disk + length, session->host->start_file);
} else if ((session->host->fast_cgi.size == 0) && (session->toolkit_fastcgi == NULL)) {
return 404;
}
if (strcmp(session->extension, "xml") != 0) {
return false;
}
if (session->extension == NULL) {
return false;
} else if (strcmp(session->extension, "xml") != 0) {
return false;
}
10.0.0.41|Thu 27 Nov 2008 13:09:02 +0200|404|0||GET /login HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.5|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive|Cache-Control: max-age=0
10.0.0.41|Thu 27 Nov 2008 13:09:07 +0200|404|0||GET / HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.5|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive
vmdebian:~/works/hiawatha/hiawatha-6.10# diff -u ~/backups/hiawatha.c.orig ./hiawatha.c
--- /root/backups/hiawatha.c.orig 2008-10-11 00:21:50.000000000 +0300
+++ ./hiawatha.c 2008-11-27 12:34:10.000000000 +0200
@@ -1010,7 +1010,7 @@
if (*(session->file_on_disk + length - 1) == '/') {
if (session->uri_is_dir) {
strcpy(session->file_on_disk + length, session->host->start_file);
- } else {
+ } else if ((session->host->fast_cgi.size == 0) && (session->toolkit_fastcgi == NULL)) {
return 404;
}
} else if (session->uri_is_dir) {
vmdebian:~/works/hiawatha/hiawatha-6.10# diff -u ~/backups/xslt.c.orig ./xslt.c
--- /root/backups/xslt.c.orig 2008-10-01 01:13:57.000000000 +0300
+++ ./xslt.c 2008-11-27 12:34:16.000000000 +0200
@@ -197,7 +197,9 @@
/* Check extension
*/
- if (strcmp(session->extension, "xml") != 0) {
+ if (session->extension == NULL) {
+ return false;
+ } else if (strcmp(session->extension, "xml") != 0) {
return false;
}
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
Binding {
Port = 80
}
Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha
StartFile = index.html
AccessLogfile = /var/www/hiawatha/access.log
ErrorLogfile = /var/www/hiawatha/error.log
## This is the interesting part:
FastCGIserver {
FastCGIid = redmineFcgi
ConnectTo = 127.0.0.1:2010
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI exists Return
Match .* FastCGI redmineFcgi
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
}
## This is the interesting part:
FastCGIserver {
FastCGIid = redmineFcgi
ConnectTo = 127.0.0.1:2011
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI isfile Return
Match .* FastCGI redmineFcgi
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/r2085/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
FastCGI = redmineFcgi ## <-- removing this line causes 403 for / and 404 for /login URLs
}
## This is the interesting part:
FastCGIserver {
FastCGIid = oneRedmineFcgi
ConnectTo = 127.0.0.1:2010
}
FastCGIserver {
FastCGIid = twoRedmineFcgi
ConnectTo = 127.0.0.1:2011
}
UrlToolkit {
ToolkitID = oneTk
Match ^/one(.*)$ Rewrite $1 Continue
Match .* FastCGI oneRedmineFcgi
}
UrlToolkit {
ToolkitID = twoTk
Match ^/two(.*)$ Rewrite $1 Continue
Match .* FastCGI twoRedmineFcgi
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI isfile Return
Match ^/one(.*)$ Goto oneTk
Match ^/two(.*)$ Goto twoTk
Match .* DenyAccess
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/r2085/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
FastCGI = oneRedmineFcgi, twoRedmineFcgi ## <-- hiawatha returns 403 and 404 if this line is removed
## if not removed/commented, the redmine code returns 404
}
## This is the interesting part:
FastCGIserver {
FastCGIid = oneRedmineFcgi
ConnectTo = 127.0.0.1:2001
}
FastCGIserver {
FastCGIid = twoRedmineFcgi
ConnectTo = 127.0.0.1:2002
}
UrlToolkit {
ToolkitID = oneTk
Match ^/one(.*)$ Rewrite $1 Continue
RequestURI isfile Return
Match .* FastCGI oneRedmineFcgi
}
UrlToolkit {
ToolkitID = twoTk
Match ^/two(.*)$ Rewrite $1 Continue
RequestURI isfile Return
Match .* FastCGI twoRedmineFcgi
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI isfile Return
Match ^/one(.*)$ Goto oneTk
Match ^/two(.*)$ Goto twoTk
Match .* DenyAccess
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/r2085/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
FastCGI = oneRedmineFcgi, twoRedmineFcgi ## <-- hiawatha returns 403 and 404 if this line is removed
## if not removed/commented, the redmine code returns 404
}
FastCGIserver {
FastCGIid = oneRedmineFcgi
ConnectTo = 127.0.0.1:2001
}
FastCGIserver {
FastCGIid = twoRedmineFcgi
ConnectTo = 127.0.0.1:2002
}
UrlToolkit {
ToolkitID = remove_one
Match /one/(.*) Rewrite /$1 Continue
Match .* FastCGI oneRedmineFcgi
}
UrlToolkit {
ToolkitID = remove_two
Match /two/(.*) Rewrite /$1 Continue
Match .* FastCGI twoRedmineFcgi
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI isfile Return
Match ^/one/ Goto remove_one
Match ^/two/ Goto remove_two
Match .* DenyAccess
}
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
Binding {
Port = 80
}
Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha
StartFile = index.html
AccessLogfile = /var/www/hiawatha/access.log
ErrorLogfile = /var/www/hiawatha/error.log
## This is the interesting part:
FastCGIserver {
FastCGIid = oneRedmineFcgi
ConnectTo = 127.0.0.1:2001
}
FastCGIserver {
FastCGIid = twoRedmineFcgi
ConnectTo = 127.0.0.1:2002
}
UrlToolkit {
ToolkitID = remove_one
Match /one/(.*) Rewrite /$1 Continue
Match .* FastCGI oneRedmineFcgi
}
UrlToolkit {
ToolkitID = remove_two
Match /two/(.*) Rewrite /$1 Continue
Match .* FastCGI twoRedmineFcgi
}
UrlToolkit {
ToolkitID = redmineTk
RequestURI isfile Return
Match ^/one/ Goto remove_one
Match ^/two/ Goto remove_two
Match .* DenyAccess
}
VirtualHost {
Hostname = redmine.lan
WebsiteRoot = /root/works/redmine/r2085/public
AccessLogfile = /var/www/default/access.log
ErrorLogfile = /var/www/default/error.log
UseToolkit = redmineTk
}
10.0.0.41|Fri 05 Dec 2008 01:39:31 +0200|404|0||GET /two/login HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.7,bg;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive
10.0.0.41|Fri 05 Dec 2008 01:40:54 +0200|403|0||GET /two/login HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.7,bg;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive
10.0.0.41|Fri 05 Dec 2008 01:45:01 +0200|403|0||GET /one/ HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.7,bg;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive
10.0.0.41|Fri 05 Dec 2008 01:45:07 +0200|403|0||GET /one/login HTTP/1.1|Host: redmine.lan|User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4|Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8|Accept-Language: en-us,en;q=0.7,bg;q=0.3|Accept-Encoding: gzip,deflate|Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive: 300|Connection: keep-alive