Created
January 16, 2010 12:06
Revisions
-
petr999 revised this gist
Jan 19, 2010 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Nginx config, the server{} section internals charset utf-8; root /var/www/bugzilla; location ~ /\.ht.*|.*(localconfig.*|\.p[ml])$ { deny all; } location /Bugzilla { deny all; } location ~ ^/data/webdot/[^/].*\.dot$ { deny all; } location ~ ^/data/attachments/[^/]* { deny all; } location = /data/duplicates.rdf { allow all; } location ~ ^/data/[^/]* { deny all; } location ~ \.cgi$ { fastcgi_pass unix:/tmp/spawner.sock; } if ($uri ~ "^(.*\.(pl|cgi))(/.+)?$") { set $unpath_script_name $1; set $path_info $3; } location /docs/ { alias /usr/local/share/doc/bugzilla/; } } -
petr999 revised this gist
Jan 19, 2010 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,11 +31,16 @@ undef $FCGI::Spawn::fcgi; # Bugzilla.pm is imported for request cache and database handle cleaning our %SAVE_ENV = %ENV; eval " use Bugzilla; " ; die $@ if $@; %ENV = %SAVE_ENV; undef %SAVE_ENV; # # You need one of two those lines below to keep from errors on fork()ed database # handles those known not to work after the fork(). # # with mysql, auto_reconnect feature is useful for persistent forks. You may not have # such an option for other DBD/DBMS software. eval 'Bugzilla->dbh->{mysql_auto_reconnect} = 1;' ; die $@ if $@; # This is to drop out database handles before fork()s, somewhy $_request_cache is undef()'d # in Bugzilla::_cleanup, need to define it after that. eval 'Bugzilla::_cleanup; $Bugzilla::_request_cache={};' ; die $@ if $@; # ... $spawn->spawn(); -
petr999 revised this gist
Jan 19, 2010 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ sub the_callout { } # ... my $spawn = FCGI::Spawn->new(); # ... # to import modules for sharing afterwards @@ -36,3 +36,7 @@ our %SAVE_ENV = %ENV; eval " use Bugzilla; " ; die $@ if $@; %ENV = %SAVE_ENV; eval 'Bugzilla::_cleanup; $Bugzilla::_request_cache={};' ; die $@ if $@; # with mysql, auto_reconnect feature is useful for persistent forks. eval 'Bugzilla->dbh->{mysql_auto_reconnect} = 1;' ; die $@ if $@; # ... $spawn->spawn(); # ... -
petr999 revised this gist
Jan 19, 2010 . 1 changed file with 23 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ # this is to be used in conjunction with # clean_inc_subnamespace => 'Bugzilla::Config' # and the new save_env feature # to avoid fork exiting after max_requests put this into the # BEGIN{ # ... @@ -13,4 +17,22 @@ sub the_callout { # clean_inc_subnamespace => 'Bugzilla::Config'} # in the FCGI::Spawn->new(); and config is # to be re-read on each request } # ... FCGI::Spawn->new # ... # to import modules for sharing afterwards map { $FCGI::Spawn::fcgi = new CGI; $spawn->callout( $_, $FCGI::Spawn::fcgi ) ; undef $CGI::Q; }( $webguiRoot.'/../www/index.pl', $bugzillaRoot.'/index.cgi', ); undef $FCGI::Spawn::fcgi; # Bugzilla.pm is imported for request cache and database handle cleaning our %SAVE_ENV = %ENV; eval " use Bugzilla; " ; die $@ if $@; %ENV = %SAVE_ENV; undef %SAVE_ENV; # to drop out database handles before fork()s, somewhy $_request_cache is undef()'d # in Bugzilla::_cleanup, need to define it after that. eval 'Bugzilla::_cleanup; $Bugzilla::_request_cache={};' ; die $@ if $@; # with mysql, auto_reconnect feature is useful for persistent forks. eval 'Bugzilla->dbh->{mysql_auto_reconnect} = 1;' ; die $@ if $@; -
petr999 revised this gist
Jan 17, 2010 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # to avoid fork exiting after max_requests put this into the # BEGIN{ # ... *CORE::GLOBAL::exit = sub { last CALLED_OUT; } # ... #} sub the_callout { do shift; CALLED_OUT: $Bugzilla::_request_cache = {}; # to be used with # clean_inc_subnamespace => 'Bugzilla::Config'} # in the FCGI::Spawn->new(); and config is # to be re-read on each request } -
petr999 created this gist
Jan 16, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ --- bugzilla.orig/Bugzilla/CGI.pm 2010-01-09 20:39:11.000000000 +0400 +++ bugzilla/Bugzilla/CGI.pm 2010-01-12 00:02:14.811537343 +0400 @@ -35,7 +35,7 @@ use CGI qw(-no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PUSH); -use base qw(CGI); +use base qw(CGI::Fast); use Bugzilla::Constants; use Bugzilla::Error; @@ -63,7 +63,7 @@ my ($invocant, @args) = @_; my $class = ref($invocant) || $invocant; - my $self = $class->SUPER::new(@args); + my $self = bless new CGI, $class; # Make sure our outgoing cookie list is empty on each invocation $self->{Bugzilla_cookie_list} = []; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ sub the_callout { do shift; map{ delete Bugzilla->request_cache->{$_} } grep { $_ ne 'params' } keys %{ Bugzilla->request_cache }; }