[Rt-commit] rt branch, webmux-removal, created. rt-3.9.6-214-g8833de7

Chia-liang Kao clkao at bestpractical.com
Fri Nov 26 22:31:58 EST 2010


The branch, webmux-removal has been created
        at  8833de7a759f884cb6da18ebb27fbe86d7bbcd2b (commit)

- Log -----------------------------------------------------------------
commit c2c9b9ca98693115eb20695e22da02a7d88f5006
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Sat Nov 27 11:07:18 2010 +0800

    Remove webmux and friends

diff --git a/Makefile.in b/Makefile.in
index 17ca548..14517ba 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -126,16 +126,6 @@ RT_READABLE_DIR_MODE	=	0755
 
 
 
-# RT_MODPERL_HANDLER is the mason handler script for mod_perl
-RT_MODPERL_HANDLER	=	webmux.pl
-# RT_SPEEDYCGI_HANDLER is the mason handler script for SpeedyCGI
-RT_SPEEDYCGI_HANDLER	=	mason_handler.scgi
-# RT_FASTCGI_HANDLER is the mason handler script for FastCGI
-RT_FASTCGI_HANDLER	=	mason_handler.fcgi
-# RT_FASTCGI_SERVER is the FastCGI server
-RT_FASTCGI_SERVER	=	fastcgi_server
-# RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
-RT_WIN32_FASTCGI_HANDLER	=	mason_handler.svc
 # RT's CLI
 RT_CLI_BIN		=	rt
 # RT's mail gateway
@@ -145,18 +135,9 @@ RT_CRON_BIN		=	rt-crontool
 
 
 
-BINARIES		=	$(RT_MODPERL_HANDLER) \
-				$(RT_MAILGATE_BIN) \
+BINARIES		=	$(RT_MAILGATE_BIN) \
 				$(RT_CLI_BIN) \
-				$(RT_CRON_BIN) \
-				$(RT_SPEEDYCGI_HANDLER) \
-				$(RT_FASTCGI_HANDLER) \
-				$(RT_FASTCGI_SERVER) \
-				$(RT_WIN32_FASTCGI_HANDLER)
-
-
-
-
+				$(RT_CRON_BIN)
 
 SYSTEM_BINARIES		=	rt-attributes-viewer \
 				rt-clean-sessions \
diff --git a/bin/fastcgi_server.in b/bin/fastcgi_server.in
deleted file mode 100644
index e120758..0000000
--- a/bin/fastcgi_server.in
+++ /dev/null
@@ -1,234 +0,0 @@
-#!@PERL@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-=head1 NAME
-
-fastcgi_server - external FastCGI server for RT
-
-=head1 USAGE
-
-    # get help
-    fastcgi_server -h
-
-    # start a server using defaults
-    fastcgi_server
-
-    # start server with custom option
-    fastcgi_server --socket /path/to/socket -n 5
-    fastcgi_server --port 12345 -n 5
-
-=head1 DESCRIPTION
-
-This is a forking external FastCGI server for RT, it can be used
-with apache and other servers supporting FastCGI technology.
-
-An advantage is lower memory usage because of sharing memory
-between process. It's easier to setup this with nginx and other
-servers that can not maintain pool of fastcgi servers, apache
-can do this.
-
-Disadvantage is that you have to start this server yourself and
-monitor it, web servers wouldn't be able to restart it on crash.
-
-=head1 OPTIONS
-
-=over 4
-
-=item -h, --help - get help
-
-=item -n, --nprocesses - number of processes to start, by default 10
-
-=item -s, --socket - socket path, by default F<RT/var/path/fastcgi.sock>
-usually F</opt/rt3/var/fastcgi.sock>.
-
-=item -p, --port - port to use instead of socket, by default socket is
-used.
-
-=item --pidfile - pid file path, by default F<RT/var/path/fastcgi.pid>.
-
-=back
-
-=head1 SERVER CONFIGURATION
-
-=head2 nginx
-
-Below you can find example of minimal config for nginx to run RT
-with this FastCGI server. It's not ideal, but a good enough start.
-
-    worker_processes  1;
-    events { worker_connections  1024; }
-
-    pid         /opt/rt3/var/nginx/server.pid;
-    error_log   /opt/rt3/var/nginx/error.log debug;
-
-    http {
-        access_log  /opt/rt3/var/nginx/access.log;
-
-        server {
-            listen       8080;
-            server_name  localhost;
-
-            location / {
-                root           /opt/rt3/share/html;
-                fastcgi_pass   unix:/opt/rt3/var/fastcgi.sock;
-
-                fastcgi_param  QUERY_STRING       $query_string;
-                fastcgi_param  REQUEST_METHOD     $request_method;
-                fastcgi_param  CONTENT_TYPE       $content_type;
-                fastcgi_param  CONTENT_LENGTH     $content_length;
-                fastcgi_param  PATH_INFO          $fastcgi_script_name;
-            }
-
-            location /NoAuth/images/ {
-                alias   /opt/rt3/share/html/NoAuth/images/;
-            }
-        }
-    }
-
-=head1 lighttpd
-
-Server config:
-
-    server.name = "localhost"
-    server.port = 80
-
-    server.username  = "rt_web_user"
-    server.groupname = "rt_web_group"
-
-    server.pid-file = "/opt/rt3/var/lighthttpd/server.pid"
-    server.errorlog = "/opt/rt3/var/lighthttpd/error.log"
-
-    server.document-root = "/opt/rt3/share/html"
-
-    server.modules = ( "mod_fastcgi" )
-    fastcgi.server = (
-        "/" => ((
-            "socket" => "/opt/rt3/var/fastcgi.sock",
-            "check-local" => "disable",
-            "fix-root-scriptname" => "enable",
-        ))
-    )
-
-=cut
-
-
-use strict;
-use warnings;
-no warnings qw(once);
-
-package RT::Interface::Web::FCGI::Server;
-use base qw(FCGI::ProcManager);
-
-package main;
-
-use Getopt::Long;
-
-my %opt = (
-    help       => 0,
-    socket     => '',
-    port       => 0,
-    nprocesses => 10,
-    pidfile    => '',
-);
-
-GetOptions(
-    'h|help!'        => \$opt{'help'},
-    's|socket=s'     => \$opt{'socket'},
-    'p|port=s'       => \$opt{'port'},
-    'n|nprocesses=s' => \$opt{'nprocesses'},
-    'pidfile=s'      => \$opt{'pidfile'},
-);
-
-if ( $opt{'help'} ) {
-    require Pod::Usage;
-    Pod::Usage::pod2usage(
-        -message => "",
-        -exitval => $opt{'help'}? 0 : 1,
-        -verbose => 99,
-        -sections => $opt{'help'}? 'NAME|USAGE|DESCRIPTION|OPTIONS' : 'NAME|USAGE',
-    );
-}
-
-$ENV{'RT_WEBMUX_HEAVY_LOAD'} = 1;
-use File::Basename;
-require (dirname(__FILE__) .'/webmux.pl');
-
-unless ( $opt{'socket'} || $opt{'port'} ) {
-    require File::Spec;
-    $opt{'socket'} = File::Spec->catfile($RT::VarPath, 'fastcgi.sock');
-}
-elsif ( $opt{'port'} ) {
-    $opt{'socket'} = ':'. $opt{'port'};
-}
-$ENV{'FCGI_SOCKET_PATH'} = $opt{'socket'};
-
-$opt{'pidfile'} ||= File::Spec->catfile($RT::VarPath, 'fastcgi.pid');
-
-require CGI::Fast;
-
-my $proc_manager = RT::Interface::Web::FCGI::Server->new({
-    n_processes => $opt{'nprocesses'} || 10,
-    pid_fname   => $opt{'pidfile'},
-});
-
-$proc_manager->pm_manage();
-
-while ( my $cgi = CGI::Fast->new ) {
-    $proc_manager->pm_pre_dispatch;
-
-    $ENV{'PATH'}   = '/bin:/usr/bin';
-    $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
-    $ENV{'SHELL'}  = '/bin/sh' if defined $ENV{'SHELL'};
-    $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
-    $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
-
-    RT::Interface::Web::Handler->HandleRequest($cgi);
-    $proc_manager->pm_post_dispatch;
-}
-
-1;
diff --git a/bin/mason_handler.fcgi.in b/bin/mason_handler.fcgi.in
deleted file mode 100755
index e4040bc..0000000
--- a/bin/mason_handler.fcgi.in
+++ /dev/null
@@ -1,72 +0,0 @@
-#!@PERL@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-use strict;
-use warnings;
-no warnings qw(once);
-
-use File::Basename;
-require (dirname(__FILE__) .'/webmux.pl');
-
-# Enter CGI::Fast mode, which should also work as a vanilla CGI script.
-require CGI::Fast;
-
-while ( my $cgi = CGI::Fast->new ) {
-    # the whole point of fastcgi requires the env to get reset here..
-    # So we must squash it again
-    $ENV{'PATH'}   = '/bin:/usr/bin';
-    $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
-    $ENV{'SHELL'}  = '/bin/sh' if defined $ENV{'SHELL'};
-    $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
-    $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
-
-    RT::Interface::Web::Handler->HandleRequest($cgi);
-
-}
-
-1;
diff --git a/bin/mason_handler.scgi.in b/bin/mason_handler.scgi.in
deleted file mode 100755
index b229fa1..0000000
--- a/bin/mason_handler.scgi.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#!@SPEEDY_BIN@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-package RT::Mason;
-
-use warnings;
-use strict;
-use File::Basename;
-
-require (dirname(__FILE__) . '/webmux.pl');
-
-require CGI;
-
-my $cgi = CGI->new;
-RT::Interface::Web::Handler->HandleRequest($cgi);
-1;
diff --git a/bin/mason_handler.svc.in b/bin/mason_handler.svc.in
deleted file mode 100755
index 097b64a..0000000
--- a/bin/mason_handler.svc.in
+++ /dev/null
@@ -1,251 +0,0 @@
-#!@PERL@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-=head1 NAME
-
-mason_handler.svc - Win32 IIS Service handler for RT
-
-=head1 SYNOPSIS
-
-    perl mason_handler.svc --install	# install as service
-    perl mason_handler.svc --deinstall	# deinstall this service
-    perl mason_handler.svc --help	# show this help
-    perl mason_handler.svc 		# launch handler from command line
-
-=head1 DESCRIPTION
-
-This script manages a stand-alone FastCGI server, and populates the necessary
-registry settings to run it with Microsoft IIS Server 4.0 or above.
-
-Before running it, you need to install the B<FCGI> module from CPAN, as well as
-B<Win32::Daemon> from L<http://www.roth.net/perl/Daemon/> if you want to install
-itself as a service.
-
-This script will automatically create a virtual directory under the IIS root;
-its name is taken from C<$WebPath> in the F<RT_Config.pm> file.  Additionally,
-please install the ISAPI binary from L<http://www.caraveo.com/fastcgi/> and set
-up an ISAPI Script Map that maps F<.html> files to F<isapi_fcgi.dll>.
-
-Once the service is launched (either via C<net start RTFastCGI> or by running
-C<perl mason_handler.svc>), a FCGI server will start and bind to port C<8284>
-(mnemonics: the ASCII value of C<R> and C<T>); the ISAPI handler's C<BindPath>
-registry setting will also be automatically populated.
-
-=cut
-
-package RT::Mason;
-
-use strict;
-use File::Basename;
-use vars '$Handler';
-require (dirname(__FILE__) . '/webmux.pl');
-
-use Cwd;
-use File::Spec;
-
-use Win32;
-use Win32::Process;
-use Win32::Service;
-use Win32::TieRegistry;
-
-my $ProcessObj;
-
-BEGIN {
-    my $runsvc = sub {
-	Win32::Process::Create(
-	    $ProcessObj, $^X, "$^X $0 --run", 0, NORMAL_PRIORITY_CLASS, "."
-	) or do {
-	    die Win32::FormatMessage( Win32::GetLastError() );
-	};
-
-	chdir File::Basename::dirname($0);
-	my $path = Cwd::cwd();
-	$path =~ s|/|\\|g;
-	$path =~ s|bin$|share\\html|;
-
-	$Win32::TieRegistry::Registry->{
-	    'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\'.
-	    'W3SVC\Parameters\Virtual Roots\\'
-	}->{RT->Config->Get('WebPath') || '/'} = "$path,,205";
-	    
-	$Win32::TieRegistry::Registry->{
-	    'HKEY_LOCAL_MACHINE\Software\FASTCGI\.html\\'
-	}->{'BindPath'} = $ENV{'FCGI_SOCKET_PATH'};
-
-	Win32::Service::StartService(Win32::NodeName, 'W3SVC');
-    };
-    
-    if ($ARGV[0] eq '--deinstall') {
-	chdir File::Basename::dirname($0);
-	my $path = Cwd::cwd();
-	$path =~ s|/|\\|g;
-
-	require Win32::Daemon;
-	Win32::Daemon::DeleteService('RTFastCGI');
-	warn "Service 'RTFastCGI' successfully deleted.\n";
-	exit;
-    }
-    elsif ($ARGV[0] eq '--install') {
-	chdir File::Basename::dirname($0);
-	my $path = Cwd::cwd();
-	$path =~ s|/|\\|g;
-
-	require Win32::Daemon;
-	Win32::Daemon::DeleteService('RTFastCGI');
-	
-	my $rv = Win32::Daemon::CreateService( {
-	    machine =>  '',
-	    name    =>  'RTFastCGI',
-	    display =>  'RT FastCGI Handler',
-	    path    =>  $^X,
-	    user    =>  '',
-	    pwd     =>  $path,
-	    description => 'Enables port 8284 as the RT FastCGI handler.',
-	    parameters  => File::Spec->catfile(
-		    $path, File::Basename::basename($0)
-	    ) . ' --service',
-	} );
-    
-	if ($rv) {
-	    warn "Service 'RTFastCGI' successfully created.\n";
-	}
-	else {
-	    warn "Failed to add service: " . Win32::FormatMessage(
-		Win32::Daemon::GetLastError()
-	    ) . "\n";
-	}
-	exit;
-    }
-    elsif ($ARGV[0] eq '--service') {
-	require Win32::Daemon;
-
-	my $PrevState = Win32::Daemon::SERVICE_START_PENDING();
-	Win32::Daemon::StartService() or die $^E;
-
-	while ( 1 ) {
-	    my $State = Win32::Daemon::State();
-	    last if $State == Win32::Daemon::SERVICE_STOPPED();
-	    
-	    if ( $State == Win32::Daemon::SERVICE_START_PENDING() ) {
-		$runsvc->();
-		Win32::Daemon::State( Win32::Daemon::SERVICE_RUNNING() );
-		$PrevState = Win32::Daemon::SERVICE_RUNNING();
-	    }
-	    elsif ( $State == Win32::Daemon::SERVICE_CONTINUE_PENDING() ) {
-		$ProcessObj->Resume;
-		Win32::Daemon::State( Win32::Daemon::SERVICE_RUNNING() );
-		$PrevState = Win32::Daemon::SERVICE_RUNNING();
-	    }
-	    elsif ( $State == Win32::Daemon::SERVICE_STOP_PENDING() ) {
-	    $ProcessObj->Kill(0);
-		Win32::Daemon::State( Win32::Daemon::SERVICE_STOPPED() );
-		$PrevState = Win32::Daemon::SERVICE_STOPPED();
-	    }
-	    elsif ( $State == Win32::Daemon::SERVICE_RUNNING() ) {
-		my $Message = Win32::Daemon::QueryLastMessage(1);
-		if ( $Message == Win32::Daemon::SERVICE_CONTROL_INTERROGATE() ) {
-		    Win32::Daemon::State( $PrevState );
-		}
-		elsif ( $Message == Win32::Daemon::SERVICE_CONTROL_SHUTDOWN() ) {
-		    Win32::Daemon::State( Win32::Daemon::SERVICE_STOP_PENDING(), 15000 );
-		}
-		elsif ( $Message != Win32::Daemon::SERVICE_CONTROL_NONE() ) {
-		    Win32::Daemon::State( $PrevState );
-		}
-	    }
-	    
-	    Win32::Sleep( 1000 );
-	}
-		
-	Win32::Daemon::StopService();
-	exit;
-    }
-    elsif ($ARGV[0] eq '--help') {
-	system("perldoc $0");
-	exit;
-    }
-    elsif ($ARGV[0] ne '--run') {
-	$SIG{__DIE__} = sub { $ProcessObj->Kill(0) if $ProcessObj };
-	$runsvc->();
-	warn "RT FastCGI Handler launched. Press [Enter] to terminate...\n";
-	<STDIN>;
-	exit;
-    }
-}
-
-###############################################################################
-
-warn "Begin listening on $ENV{'FCGI_SOCKET_PATH'}\n";
-
-require CGI::Fast;
-
-RT::Init();
-$Handler ||= RT::Interface::Web::Handler->new( RT->Config->Get('MasonParameters'));
-
-
-# Response loop
-while( my $cgi = CGI::Fast->new ) {
-    $Handler->HandleRequest($cgi);
-}
-
-1;
-
-=head1 AUTHORS
-
-Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
-
-=head1 COPYRIGHT
-
-Copyright 2002 by Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>.
-
-This program is free software; you can redistribute it and/or 
-modify it under the same terms as Perl itself.
-
-See L<http://www.perl.com/perl/misc/Artistic.html>
-
-=cut
diff --git a/bin/webmux.pl.in b/bin/webmux.pl.in
deleted file mode 100755
index 7fef7db..0000000
--- a/bin/webmux.pl.in
+++ /dev/null
@@ -1,174 +0,0 @@
-#!@PERL@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <jesse at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-use strict;
-local $ENV{'PATH'}   = '/bin:/usr/bin';                   # or whatever you need
-local $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
-local $ENV{'SHELL'}  = '/bin/sh' if defined $ENV{'SHELL'};
-local $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
-local $ENV{'IFS'}    = '' if defined $ENV{'IFS'};
-
-package HTML::Mason::Commands;
-our %session;
-
-package RT::Mason;
-
-our ($Nobody, $SystemUser, $Handler, $r);
-
-sub handler {
-    ($r) = @_;
-
-    local $SIG{__WARN__};
-    local $SIG{__DIE__};
-    RT::InitSignalHandlers();
-
-    if ($r->content_type =~ m/^httpd\b.*\bdirectory/i) {
-        use File::Spec::Unix;
-        # Our DirectoryIndex is always index.html, regardless of httpd settings
-        $r->filename( File::Spec::Unix->catfile( $r->filename, 'index.html' ) );
-    }
-
-    Module::Refresh->refresh if RT->Config->Get('DevelMode');
-
-    RT::ConnectToDatabase();
-
-    my (%session, $status);
-    {
-        local $@;
-        $status = eval { $Handler->handle_request($r) };
-        $RT::Logger->crit( $@ ) if $@;
-    }
-    undef %session;
-
-    RT::Interface::Web::Handler->CleanupRequest();
-
-    return $status;
-}
-
-package main;
-
-# check mod_perl version if it's mod_perl
-BEGIN {
-    die "RT does not support mod_perl 1.99. Please upgrade to mod_perl 2.0"
-        if $ENV{'MOD_PERL'}
-        and $ENV{'MOD_PERL'} =~ m{mod_perl/(?:1\.9)};
-}
-
-require CGI;
-CGI->import(qw(-private_tempfiles));
-
-# fix lib paths, some may be relative
-BEGIN {
-    require File::Spec;
-    my @libs = ("@RT_LIB_PATH@", "@LOCAL_LIB_PATH@");
-    my $bin_path;
-
-    for my $lib (@libs) {
-        unless ( File::Spec->file_name_is_absolute($lib) ) {
-            unless ($bin_path) {
-                if ( File::Spec->file_name_is_absolute(__FILE__) ) {
-                    $bin_path = ( File::Spec->splitpath(__FILE__) )[1];
-                }
-                else {
-                    require FindBin;
-                    no warnings "once";
-                    $bin_path = $FindBin::Bin;
-                }
-            }
-            $lib = File::Spec->catfile( $bin_path, File::Spec->updir, $lib );
-        }
-        unshift @INC, $lib;
-    }
-
-}
-
-require RT;
-die "Wrong version of RT $RT::Version found; need @RT_VERSION_MAJOR at .@RT_VERSION_MINOR at .*"
-    unless $RT::VERSION =~ /^@RT_VERSION_MAJOR@\. at RT_VERSION_MINOR@\./;
-RT::LoadConfig();
-if ( RT->Config->Get('DevelMode') ) {
-    require Module::Refresh;
-}
-RT::Init();
-
-# check compatibility of the DB
-{
-    my $dbh = $RT::Handle->dbh;
-    if ( $dbh ) {
-        my ($status, $msg) = $RT::Handle->CheckCompatibility( $dbh, 'post' );
-        die $msg unless $status;
-    }
-}
-
-require RT::Interface::Web::Handler;
-# XXX: this is for the maybe-used package variable of the modperl handler: RT::Mason
-$RT::Mason::Handler = RT::Interface::Web::Handler->Init(undef,
-                                                        RT->Config->Get('MasonParameters'));
-
-# load more for mod_perl before forking
-RT::InitClasses( Heavy => 1 ) if $ENV{'MOD_PERL'} || $ENV{RT_WEBMUX_HEAVY_LOAD};
-
-# we must disconnect DB before fork
-$RT::Handle->dbh(undef);
-undef $RT::Handle;
-
-if ( $ENV{'MOD_PERL'} && !RT->Config->Get('DevelMode')) {
-    # Under static_source, we need to purge the component cache
-    # each time we restart, so newer components may be reloaded.
-    #
-    # We can't do this in FastCGI or we'll blow away the component
-    # root _every_ time a new server starts which happens every few
-    # hits.
-    
-    require File::Path;
-    require File::Glob;
-    my @files = File::Glob::bsd_glob("$RT::MasonDataDir/obj/*");
-    File::Path::rmtree([ @files ], 0, 1) if @files;
-}
-
-1;
diff --git a/configure.ac b/configure.ac
index ceea142..fe4b826 100755
--- a/configure.ac
+++ b/configure.ac
@@ -415,9 +415,6 @@ AC_CONFIG_FILES([
                  sbin/standalone_httpd
                  sbin/rt-setup-fulltext-index
                  sbin/rt-fulltext-indexer
-                 bin/fastcgi_server
-                 bin/mason_handler.fcgi
-                 bin/mason_handler.scgi
                  bin/rt-crontool
                  bin/rt-mailgate
                  bin/rt],
@@ -429,8 +426,6 @@ AC_CONFIG_FILES([
                  Makefile
                  etc/RT_Config.pm
                  lib/RT/Generated.pm
-                 bin/mason_handler.svc
-                 bin/webmux.pl
                  t/data/configs/apache2.2+mod_perl.conf
                  t/data/configs/apache2.2+fastcgi.conf],
                )

commit 3d5c61f0bf578a3f874d82e4eba3b5da4bd2d006
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Sat Nov 27 11:14:15 2010 +0800

    Remove non-psgi web interface codepath

diff --git a/lib/RT/Interface/Web/Handler.pm b/lib/RT/Interface/Web/Handler.pm
index c7b5e16..f3ba409 100644
--- a/lib/RT/Interface/Web/Handler.pm
+++ b/lib/RT/Interface/Web/Handler.pm
@@ -82,57 +82,6 @@ sub DefaultHandlerArgs  { (
     named_component_subs => $INC{'Devel/Cover.pm'} ? 1 : 0,
 ) };
 
-
-=head2 new
-
-DEPRECATED: this method is to be removed as it's not the constructor of the class which is confusing
-
-  Constructs a web handler of the appropriate class.
-  Takes options to pass to the constructor.
-
-=cut
-
-sub new {
-    Carp::carp "DEPRECATED: call RT::Interface::Handler->Init instead";
-    my $class = shift;
-    $class->InitSessionDir;
-
-    if ( ($mod_perl::VERSION && $mod_perl::VERSION >= 1.9908) || $CGI::MOD_PERL) {
-        goto &NewApacheHandler;
-    }
-    else {
-        goto &NewCGIHandler;
-    }
-}
-
-=head2 Init
-
-  Initialize and return the mason web handler for current environment.
-
-=cut
-
-my $_handler;
-
-sub Init {
-    my $class = shift;
-    my $handler_class = shift;
-    my @handler_args = @_;
-
-    $class->InitSessionDir;
-
-    unless ($handler_class) {
-        if ( ($mod_perl::VERSION && $mod_perl::VERSION >= 1.9908) || $CGI::MOD_PERL) {
-            $handler_class = 'HTML::Mason::ApacheHandler';
-            unshift @handler_args, args_method => "CGI";
-        }
-        else {
-            $handler_class = 'HTML::Mason::CGIHandler';
-        }
-    }
-
-    $_handler = NewHandler($handler_class, @handler_args);
-}
-
 sub InitSessionDir {
     # Activate the following if running httpd as root (the normal case).
     # Resets ownership of all files created by Mason at startup.
@@ -158,72 +107,6 @@ sub InitSessionDir {
 }
 
 
-
-=head2 NewApacheHandler
-
-  Takes extra options to pass to HTML::Mason::ApacheHandler->new
-  Returns a new Mason::ApacheHandler object
-
-=cut
-
-sub NewApacheHandler {
-    require HTML::Mason::ApacheHandler;
-    return NewHandler('HTML::Mason::ApacheHandler', args_method => "CGI", @_);
-}
-
-
-
-=head2 NewCGIHandler
-
-  Returns a new Mason::CGIHandler object
-
-=cut
-
-sub NewCGIHandler {
-    require HTML::Mason::CGIHandler;
-    return NewHandler(
-        'HTML::Mason::CGIHandler',
-        out_method => sub {
-            my $m = HTML::Mason::Request->instance;
-            my $r = $m->cgi_request;
-
-            # Send headers if they have not been sent by us or by user.
-            $r->send_http_header unless $r->http_header_sent;
-
-            # Set up a default
-            $r->content_type('text/html; charset=utf-8')
-                unless $r->content_type;
-
-            if ( $r->content_type =~ /charset=([\w-]+)$/ ) {
-                my $enc = $1;
-                if ( lc $enc !~ /utf-?8$/ ) {
-                    for my $str (@_) {
-                        next unless $str;
-
-                        # only encode perl internal strings
-                        next unless utf8::is_utf8($str);
-                        $str = Encode::encode( $enc, $str );
-                    }
-                }
-            }
-
-            # default to utf8 encoding
-            for my $str (@_) {
-                next unless $str;
-                next unless utf8::is_utf8($str);
-                $str = Encode::encode( 'utf8', $str );
-            }
-
-            # We could perhaps install a new, faster out_method here that
-            # wouldn't have to keep checking whether headers have been
-            # sent and what the $r->method is.  That would require
-            # additions to the Request interface, though.
-            print STDOUT grep {defined} @_;
-        },
-        @_
-    );
-}
-
 use UNIVERSAL::require;
 sub NewHandler {
     my $class = shift;
@@ -253,30 +136,6 @@ sub _mason_dir_index {
     return $path;
 }
 
-=head2 HandleRequest
-
-
-=cut
-
-sub HandleRequest {
-    my $self = shift;
-    my $cgi = shift;
-
-    Module::Refresh->refresh if RT->Config->Get('DevelMode');
-    RT::ConnectToDatabase() unless RT->InstallMode;
-
-    my $interp = $_handler->interp;
-    $cgi->path_info( $self->_mason_dir_index($interp, $cgi->path_info));
-
-    local $@;
-    eval { $_handler->handle_cgi_object($cgi); };
-    if ($@) {
-        $RT::Logger->crit($@);
-    }
-    $self->CleanupRequest();
-
-}
-
 
 =head2 CleanupRequest
 

commit 0c9af1f9a2499ce8f067991df1c845210c24695d
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Sat Nov 27 11:16:32 2010 +0800

    remove crazy alter_superclass for web::request

diff --git a/lib/RT/Interface/Web/Request.pm b/lib/RT/Interface/Web/Request.pm
index 4e68740..30df5a3 100644
--- a/lib/RT/Interface/Web/Request.pm
+++ b/lib/RT/Interface/Web/Request.pm
@@ -52,52 +52,16 @@ use strict;
 use warnings;
 
 our $VERSION = '0.30';
-use base qw(HTML::Mason::Request);
+use HTML::Mason::PSGIHandler;
+use base qw(HTML::Mason::Request::PSGI);
 use Params::Validate qw(:all);
 
 sub new {
     my $class = shift;
-
-    my $new_class =
-         $HTML::Mason::ApacheHandler::VERSION ? 'HTML::Mason::Request::ApacheHandler' :
-         $HTML::Mason::PSGIHandler::VERSION   ? 'HTML::Mason::Request::PSGI' :
-         $HTML::Mason::CGIHandler::VERSION    ? 'HTML::Mason::Request::CGI' :
-                                                'HTML::Mason::Request';
-
-    $class->alter_superclass( $new_class );
-    $class->valid_params( %{ $new_class->valid_params },cgi_request => { type => OBJECT, optional => 1 } );
+    $class->valid_params( %{ $class->valid_params },cgi_request => { type => OBJECT, optional => 1 } );
     return $class->SUPER::new(@_);
 }
 
-# XXX TODO: This alter_superclass replaces teh funcitonality in Mason 1.39 
-# with code which doesn't trigger a bug in Perl 5.10. 
-# (Perl 5.10.0 does NOT take kindly to having its @INC entries changed)
-# http://rt.perl.org/rt3/Public/Bug/Display.html?id=54566
-#
-# This routine can be removed when either: 
-#   * RT depends on a version of mason which contains this fix
-#   * Perl 5.10.0 is not supported for running RT
-sub alter_superclass {
-    my $class = shift;
-    my $new_super = shift;
-    my $isa_ref;
-    { no strict 'refs'; my @entries = @{$class."::ISA"}; $isa_ref = \@entries; }
-
-    # handles multiple inheritance properly and preserve
-    # inheritance order
-    for ( my $x = 0; $x <= $#{$isa_ref} ; $x++ ) {
-        if ( $isa_ref->[$x]->isa('HTML::Mason::Request') ) {
-            my $old_super = $isa_ref->[$x];
-                $isa_ref->[$x] = $new_super
-            if ( $old_super ne $new_super );
-            last;
-        }
-    } 
-
-    { no strict 'refs'; @{$class."::ISA"} = @$isa_ref; }
-    $class->valid_params( %{ $class->valid_params } );
-}
-
 
 =head2 callback
 

commit 8833de7a759f884cb6da18ebb27fbe86d7bbcd2b
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Sat Nov 27 11:24:03 2010 +0800

    we dont need web_handler specified anymore

diff --git a/Makefile.in b/Makefile.in
index 14517ba..84a87b2 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -257,14 +257,13 @@ upgrade-instruct:
 
 upgrade: testdeps config-install dirs files-install fixperms upgrade-instruct
 
-my_with_web_handlers= $(shell $(PERL) -e 'print join " ", map "--with-$$_", grep defined && length, split /,/, "$(WEB_HANDLER)"')
 testdeps:
-	$(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE) $(my_with_web_handlers)
+	$(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE)
 
 depends: fixdeps
 
 fixdeps:
-	$(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE) $(my_with_web_handlers)
+	$(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE)
 
 #}}}
 
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 5f9d190..6b89d10 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -60,9 +60,7 @@ GetOptions(
     \%args,                               'v|verbose',
     'install',                            'with-MYSQL',
     'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE',
-    'with-ORACLE',                        'with-FASTCGI', 'with-FASTCGI-SERVER',
-    'with-SPEEDYCGI',                     'with-MODPERL1',
-    'with-MODPERL2',                      'with-DEV',
+    'with-ORACLE',                        'with-DEV',
 
     'with-GPG',
     'with-ICAL',
@@ -230,6 +228,7 @@ IPC::Run3
 .
 
 $deps{'PSGI'} = [ text_to_hash( << '.') ];
+CGI 3.38
 CGI::PSGI 0.12
 HTML::Mason::PSGIHandler 0.52
 Plack 0.9942
@@ -277,40 +276,6 @@ Test::WWW::Mechanize::PSGI
 Plack::Middleware::Test::StashWarnings
 .
 
-$deps{'FASTCGI'} = [ text_to_hash( << '.') ];
-CGI 3.38
-FCGI
-CGI::Fast 
-.
-
-$deps{'FASTCGI-SERVER'} = [ text_to_hash( << '.') ];
-CGI 3.38
-CGI::Fast
-FCGI::ProcManager
-File::Basename
-File::Spec
-Getopt::Long
-Pod::Usage
-.
-
-$deps{'SPEEDYCGI'} = [ text_to_hash( << '.') ];
-CGI 3.38
-CGI::SpeedyCGI
-.
-
-
-$deps{'MODPERL1'} = [ text_to_hash( << '.') ];
-CGI 3.38
-Apache::Request
-Apache::DBI 0.92
-.
-
-$deps{'MODPERL2'} = [ text_to_hash( << '.') ];
-CGI 3.38
-Apache::DBI
-HTML::Mason 1.36
-.
-
 $deps{'MYSQL'} = [ text_to_hash( << '.') ];
 DBD::mysql 2.1018
 .

-----------------------------------------------------------------------


More information about the Rt-commit mailing list