Added Apache CGI/FCGI/mod_perl examples
This commit is contained in:
parent
e9893b25f4
commit
784e0bd73c
5 changed files with 39 additions and 2 deletions
21
apache.conf
Normal file
21
apache.conf
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<VirtualHost *:80>
|
||||||
|
PerlOptions +Parent
|
||||||
|
PerlSwitches -I/data/WebGUI/lib
|
||||||
|
|
||||||
|
# CGI
|
||||||
|
#AddHandler cgi-script cgi
|
||||||
|
#ScriptAlias / /data/WebGUI/etc/dev.localhost.localdomain.cgi/
|
||||||
|
#<Directory /data/WebGUI/etc>
|
||||||
|
# Options +ExecCGI
|
||||||
|
#</Directory>
|
||||||
|
|
||||||
|
# Apache2
|
||||||
|
#SetHandler perl-script
|
||||||
|
#PerlHandler Plack::Server::Apache2
|
||||||
|
#PerlSetVar psgi_app /data/WebGUI/etc/dev.localhost.localdomain.psgi
|
||||||
|
|
||||||
|
# FastCGI
|
||||||
|
FastCgiServer /data/WebGUI/etc/dev.localhost.localdomain.fcgi
|
||||||
|
ScriptAlias / /data/WebGUI/etc/dev.localhost.localdomain.fcgi/
|
||||||
|
|
||||||
|
</VirtualHost>
|
||||||
5
etc/dev.localhost.localdomain.cgi
Executable file
5
etc/dev.localhost.localdomain.cgi
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
use Plack::Server::CGI;
|
||||||
|
|
||||||
|
my $app = Plack::Util::load_psgi("/data/WebGUI/etc/dev.localhost.localdomain.psgi");
|
||||||
|
Plack::Server::CGI->new->run($app);
|
||||||
5
etc/dev.localhost.localdomain.fcgi
Executable file
5
etc/dev.localhost.localdomain.fcgi
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
use Plack::Server::FCGI;
|
||||||
|
|
||||||
|
my $app = Plack::Util::load_psgi("/data/WebGUI/etc/dev.localhost.localdomain.psgi");
|
||||||
|
Plack::Server::FCGI->new->run($app);
|
||||||
|
|
@ -6,7 +6,8 @@ BEGIN {
|
||||||
our $WEBGUI_CONFIG = 'dev.localhost.localdomain';
|
our $WEBGUI_CONFIG = 'dev.localhost.localdomain';
|
||||||
our $DOCUMENT_ROOT = '/data/domains/dev.localhost.localdomain/public';
|
our $DOCUMENT_ROOT = '/data/domains/dev.localhost.localdomain/public';
|
||||||
}
|
}
|
||||||
use local::lib $WEBGUI_ROOT;
|
use lib "$WEBGUI_ROOT/lib";
|
||||||
|
#use local::lib $WEBGUI_ROOT;
|
||||||
use WebGUI;
|
use WebGUI;
|
||||||
use Plack::Builder;
|
use Plack::Builder;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,17 @@ sub headers_out { shift->{headers_out} }
|
||||||
sub protocol { shift->{request}->protocol(@_) }
|
sub protocol { shift->{request}->protocol(@_) }
|
||||||
sub status { shift->{response}->status(@_) }
|
sub status { shift->{response}->status(@_) }
|
||||||
sub sendfile { $_[0]->{sendfile} = $_[1] }
|
sub sendfile { $_[0]->{sendfile} = $_[1] }
|
||||||
sub content_type { shift->{response}->content_type(@_) }
|
|
||||||
sub server { shift->{server} }
|
sub server { shift->{server} }
|
||||||
sub method { shift->{request}->method }
|
sub method { shift->{request}->method }
|
||||||
sub upload { shift->{request}->upload(@_) }
|
sub upload { shift->{request}->upload(@_) }
|
||||||
sub status_line { }
|
sub status_line { }
|
||||||
sub auth_type { } # should we support this?
|
sub auth_type { } # should we support this?
|
||||||
|
sub handler { 'perl-script' } # or not..?
|
||||||
|
|
||||||
|
sub content_type {
|
||||||
|
my ($self, $ct) = @_;
|
||||||
|
$self->{headers_out}->set( 'Content-Type' => $ct );
|
||||||
|
}
|
||||||
|
|
||||||
# These two cookie subs are called from our wG Plack-specific code
|
# These two cookie subs are called from our wG Plack-specific code
|
||||||
sub get_request_cookies {
|
sub get_request_cookies {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue