我是FastCGI的新手,并希望使用这个平台来加速我现有的vanilla CGI(perl)程序.
但是在阅读FastCGI/Apache FAQ时,似乎我可以在Apache配置中设置我的脚本(一旦转换为使用单独的初始化/请求部分),如下所示:
1)动态
2)静态"在SetHandler的范围内"
3)静态"在AddHandler的范围内"
4)静态"在Set/AddHandler范围之外"(或者,我认为,这可以称为'外部')
我对这四个选项感到困惑,我假设"动态"的默认值是我应该使用的,但有人可以解释这些的优点/缺点吗?
我找到了http://support.zeus.com/zws/examples/2005/12/16/hello_world_in_perl_and_c,这两个例子正在运行.
现在我为Ada尝试了这个,我从2天后就无法完成它.
fcgi_stdio.ads
with Interfaces.C;
with Interfaces.C.Strings;
package fcgi_stdio is
function FCGI_Accept return Interfaces.C.int;
pragma Import (C, FCGI_Accept, "FCGI_Accept");
procedure FCGI_printf (str : Interfaces.C.Strings.chars_ptr);
pragma Import (C, FCGI_printf, "FCGI_printf");
end fcgi_stdio;
Run Code Online (Sandbox Code Playgroud)
test.adb
with fcgi_stdio;
with Interfaces.C;
with Interfaces.C.Strings;
procedure Test is
begin
while Integer (fcgi_stdio.FCGI_Accept) >= 0 loop
fcgi_stdio.FCGI_printf (Interfaces.C.Strings.New_String ("Content-Type: text/plain" & ASCII.LF & ASCII.LF));
fcgi_stdio.FCGI_printf (Interfaces.C.Strings.New_String ("Hello World from Ada!" & ASCII.LF));
end loop;
end Test;
Run Code Online (Sandbox Code Playgroud)
当我在控制台中运行它时,我收到以下错误:
$ ./test
raised STORAGE_ERROR : stack overflow or erroneous …Run Code Online (Sandbox Code Playgroud) 我编写了一个简单的perl脚本,我在Apache上通过fastCGI运行.应用程序加载一组XML数据文件,这些文件用于根据传入请求的查询参数查找值.据我了解,如果我想增加应用程序可以处理的并发请求量,我需要允许fastCGI生成多个进程.这些进程中的每一个都必须在内存中保存XML数据的重复副本吗?有没有办法设置,以便我可以在内存中加载一份XML数据,同时增加处理并发请求的能力?
app = redmine-2.0.1
ruby = ruby 1.9.3p194(2012-04-20 revision 35410)[x86_64-linux]
[root@by1016690 public]# ./dispatch.fcgi
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- fcgi (LoadError)
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler/fastcgi.rb:1:in `<top (required)>'
from ./dispatch.fcgi:19:in `<main>'
Run Code Online (Sandbox Code Playgroud) 我的服务器安装了带有nginx的CentOS 6.2和来自remi repos的php-fpm
httpd也安装了,但是当我尝试安装mod_fastcgi yum sais时,没有pachage可用
我怎么能安装mod_fastcgi ??? 谷歌搜索不同的网站说这个命令
yum install mod_fastcgi
Run Code Online (Sandbox Code Playgroud)
必须安装此包.但是yum sais:
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* epel: mirror.cogentco.com
* remi: remi-mirror.dedipower.com
196 packages excluded due to repository priority protections
Setting up Install Process
No package mod_fastcgi available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud) 我本地安装了 XAMPP。由于某些原因(Java-Php-Bridge)我必须使用 FastCGI。所以我使用本指南进行设置:http://www3.umoncton.ca/dashboard/docs/use-php-fcgi.html
这工作正常,但现在我无法访问http://localhost/phpmyadmin/ 错误是:
禁止访问!
新的XAMPP安全概念:
只能从本地网络访问所请求的目录。
可以在文件“httpd-xampp.conf”中配置此设置。
这是我的“httpd-xampp.conf”文件:
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
SetEnv PHPRC "\\xampp\\php"
SetEnv TMP "\\xampp\\tmp"
</IfModule>
#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php5ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
#LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
LoadModule fcgid_module modules/mod_fcgid.so
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php
#</FilesMatch>
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>
FcgidInitialEnv PHPRC "c:/xampp/php"
AddHandler fcgid-script .php
FcgidWrapper "c:/xampp/php/php-cgi.exe" .php
#
# PHP-CGI setup
#
#<FilesMatch …Run Code Online (Sandbox Code Playgroud)