FastCGI 插件 SAF "auth-fastcgi"、" responder-fastcgi" 和 "filter-fastcgi" 全都接受下列参数,除非另外显式说明:
bind-path-(可选)可以是 UNIX 域套接字名称或命名管道,或者采用 host:port 格式。对 app-path 参数的说明解释了 bind-path 参数的用法。
app-path-(可选)处理请求的 FastCGI 应用程序路径。该功能依赖于 bind-path 参数的值,如下所示:
如果仅指定了 app-path,插件将创建 FastCGI 应用程序,该应用程序侦听由插件创建的 UNIX 域套接字或命名管道。
如果同时指定了 app-path 和 bind-path,插件将启动指定的 FastCGI 应用程序进程并将它们绑定到指定的 bind-path。
如果仅指定了 bind-path,则 FastCGI 应用程序将被认为正在远程运行。因此,插件将不启动 FastCGI 应用程序进程。
如果既未指定 "app-path",也未指定 "bind-path",则插件将记录错误消息。
app-args-(可选)作为参数传递至 FastCGI 应用程序进程的值。允许使用多个 app-args 参数。多个 app-args 参数的格式为 app-args="value" app-args="value" ..。
app-env-(可选)作为环境变量传递到 FastCGI 应用程序进程的值对。允许使用多个 "app-env" 参数。多个 app-env 参数的格式为 app-env="name=value" app-env="name=value"。不会将现有 Web Server 环境变量传递给 FastCGI 程序。因此,应使用 app-env 显式地为 FastCGI 程序设置环境变量。
要编译 PHP 程序,应确保正确配置库文件。
例如,如果要装入已编译为 FastCGI 应用程序的 PHP 二进制文件,您需要确保将所有相关库文件(/usr/local/lib 和 /usr/local/mysql/lib)导出到 LD_LIBRARY_PATH 中。
app-env="LD_LIBRARY_PATH=/usr/local/lib:/usr/local/mysql/lib"
对于 Windows,app-env="Path=c:/php/lib:c:/mysql/lib"
使用 app-env 也可以将其他环境变量导出到 PHP 应用程序中。您可以将 php.ini 文件位置指定为 app-env="PHPRC=<directory path>"。
在使用 PHP 时,您需要为 PHP_FCGI_CHILDREN 和 PHP_FCGI_MAX_REQUESTS 提供较高的值,以便在为 PHP 配置 FastCGI 时获得较高的优先级。
min-procs -(可选)一个整数,用来指定要创建的 FastCGI 应用程序进程的最小数目。默认值为 1。
max-procs-(可选)一个整数,用来指定随时可以创建的 FastCGI 应用程序进程的最大数目。该整数值必须等于或大于 min-procs。默认值为 1。
目前,默认值为非操作参数。有关此问题的更多信息,请参见《Sun Java System Web Server 7.0 Update 3 发行说明》中的“FastCGI ”。
reuse-connection-(可选)一个布尔值,用来确定是否重复使用 FastCGI 应用程序连接。False(0、false 或 no)表示在每个请求后关闭与 FastCGI 应用程序的连接。True(1、true 或 yes)表示对新请求重复使用现有连接。默认值为 false。另请参见 connection-timeout。
connection-timeout-(可选)如果 "reuse-connection" 被设置为 True,则此值指定池化连接的超时值(以秒为单位)。如果连接在指定的时间段内处于空闲状态,则插件将关闭该连接。此参数的默认值为 5 秒。另请参见 reuse-connection。
resp-timeout-(可选)一个整数,用来表示 FastCGI 服务器响应超时(以秒为单位)。如果在指定时间段内 FastCGI 应用程序未响应,将放弃请求。此参数的默认值为 5 分钟。
restart-interval-(可选)一个整数,用来表示两次重新启动 FastCGI 应用程序之间的时间间隔(以分钟为单位)。此参数的默认值为 60 分钟(1 小时)。如果将此参数的值设置为零,则不会强制重新启动 FastCGI 应用程序。
req-retry-(可选)一个整数,用来表示在 FastCGI 应用程序拒绝请求时插件应重新发送该请求的次数。此参数的默认值为零。
listen-queue-(可选)一个整数,用来指定套接字的侦听队列大小。此参数的默认值为 256。
rlimit_cpu-指定 FastCGI 程序使用的最长 CPU 时间(以秒为单位)。只能指定当前(软)限制。最大(硬)限制不适用于此参数,将忽略此限制。
请注意,chroot、user、group、nice、chdir、rlimit_as、rlimit_core 和 rlimit_nofile 参数仅适用于 UNIX 平台。在 Windows 平台上,这些参数都将被忽略。
chroot-(可选,仅适用于 UNIX)用于设置 chroot FastCGI 服务器应用程序进程的根目录。
user-(可选,仅适用于 UNIX)指定用于运行 FastCGI 应用程序的用户 ID。默认值为 Web Server 的用户 ID。
group-(可选,仅适用于 UNIX)将使用指定的组运行 FastCGI 应用程序。默认值为 Web Server 的组。
nice-(可选,仅适用于 UNIX)指定 FastCGI 应用程序进程的 nice/priority 值。
chdir-(可选,仅适用于 UNIX)指定在发出 chroot 命令后但在执行开始之前要 chdir 的目录。
rlimit_as-(可选,仅适用于 UNIX)指定最大 CGI 程序地址空间(以字节为单位)。可以提供当前(软)和最大(硬)限制,并用逗号隔开。必须先列出软限制。如果仅指定一个限制,则会将两个限制均设置为该值。
rlimit_core-(可选,仅适用于 UNIX)指定最大 CGI 程序核心文件大小。如果值为 0,则会禁止写入核心。可以提供当前(软)和最大(硬)限制,并用逗号隔开。必须先列出软限制。如果仅指定一个限制,则会将两个限制均设置为该值。
rlimit_nofile-(可选,仅适用于 UNIX)指定 CGI 程序的文件描述符的最大数目。可以提供当前(软)和最大(硬)限制,并用逗号隔开。必须先列出软限制。如果仅指定一个限制,则会将两个限制均设置为该值。
error-fastcgi 服务器应用程序函数 (Server Application Function, SAF) 接受以下参数:
error-url-指定在出现故障或错误时显示的页面、URI 或 URL。此参数的值可以为绝对路径、相对于文档根目录的路径、URL 或 URI。
error-reason-(可选)表示 FastCGI 协议错误的字符串。此字符串用来在发生任何插件错误时区分要显示的错误 URL。