文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>CGI::Application and lighttpd

CGI::Application and lighttpd

时间:2009-03-30  来源:cobrawgl

From:http://trac.lighttpd.net/trac/wiki/ApplicationsUsingLighttpd

Yet Another Using a Perl dispatcher instead of mod_perl

I am using CGI::Application and lighty 1.4.11. The only module you need to install is CGI::Fast which is a pure perl module. The C::A app runs fine with little change in the instance script. CGI::Application::Dispatch can be used if you use multiple instance scripts. -- Qiang@cgiapp from freenode.

here is my instance script ( or dispatcher ).

#!/usr/bin/perl -w use strict; use warnings; use My::App; use CGI::Fast(); while (my $q = new CGI::Fast){ my $webapp = My::App->new( QUERY => $q ); $webapp->run(); } #### below is what i have for mod_perl.  #### you can see there isn't much change after migrating to lighty. #!/usr/bin/perl -w use strict; use warnings; use My::App; use CGI::Fast; my $webapp = My::App->new(); $webapp->run(); 

here is my lighty conf:

 ### here is the fastcgi server $HTTP["host"] == "dev.example.com" { var.root = "/path/to/app/root/" server.document-root = var.root + "htdocs/" url.rewrite = ( "^/static/.*" => "$0", "^/([a-zA-Z_]+)$" => "/index.pl/$1", "^/([a-zA-Z_]+/.*)$" => "/index.pl/$1" ) fastcgi.server = ( ".pl" => (( "bin-path" => var.root + "htdocs/index.pl", "bin-environment" => ( "PERL5LIB" => var.root + "lib", "CGIAPP_CONFIG_FILE" => var.root + "conf/my.conf" ), "socket" => "/tmp/perl.socket", "check-local" => "disable", "min-procs" => 2, "max-procs" => 5, "idle-timeout" => 20 ))) } # this is for plain cgi $HTTP["host"] == "dev1.example.com" { alias.url = ( "/bin/" => "/app/htdocs/bin/" ) $HTTP["url"] =~ "^/bin" { setenv.add-environment = ( "DEVMODE" => "dev" ) cgi.assign = ( ".pl" => "/usr/bin/perl" ) } } 
相关阅读 更多 +
排行榜 更多 +
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载
几何飞行安卓版

几何飞行安卓版

飞行射击 下载