File manager - Edit - /usr/local/lswsbak/docs/zh-CN/CGI_Context.html
Back
<!DOCTYPE html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <title>OpenLiteSpeed Users' Manual - CGI Context</title> <meta name="description" content="OpenLiteSpeed Users' Manual - CGI Context." /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="robots" content="noindex"> <link rel="shortcut icon" href="../img/favicon.ico" /> <link rel="stylesheet" type="text/css" href="../css/hdoc.css"> </head> <body> <div class="pagewrapper clearfix"><aside class="sidetree ls-col-1-5"> <figure> <img src="img/ols_logo.svg" alt="openlitespeed logo" width="150px"/> </figure> <h2 class="ls-text-thin"> OpenLiteSpeed Web Server <a href="index.html"> Users' Manual</a> </h2> <h3 class="ls-text-muted">Version 1.8 — Rev. 3</h3> <hr/> <div> <ul> <li><a href="license.html">License</a></li> <li><a href="intro.html">Introduction</a></li> <li><a href="install.html">Installation</a></li> <li> <a href="admin.html">Administration</a> <ul class="level2"> <li><a href="ServerStat_Help.html">Service Manager</a></li> <li><a href="Real_Time_Stats_Help.html">Real-Time Stats</a></li> </ul> </li> <li><a href="security.html">Security</a></li> <li> <a href="config.html">Configuration</a> <ul class="level2"> <li><a href="ServGeneral_Help.html">Server General</a></li> <li><a href="ServLog_Help.html">Server Log</a></li> <li><a href="ServTuning_Help.html">Server Tuning</a></li> <li><a href="ServSecurity_Help.html">Server Security</a></li> <li><a href="ExtApp_Help.html">External Apps</a></li> <ul class="level3"> <li><a href="External_FCGI.html">Fast CGI App</a></li> <li><a href="External_FCGI_Auth.html">Fast CGI Authorizer</a></li> <li><a href="External_LSAPI.html">LSAPI App</a></li> <li><a href="External_Servlet.html">Servlet Engine</a></li> <li><a href="External_WS.html">Web Server</a></li> <li><a href="External_PL.html">Piped logger</a></li> <li><a href="External_LB.html">Load Balancer</a></li> </ul> <li><a href="ScriptHandler_Help.html">Script Handler</a></li> <li><a href="App_Server_Help.html">App Server Settings</a></li> <li><a href="Module_Help.html">Module Configuration</a></li> <li><a href="Listeners_General_Help.html">Listener General</a></li> <li><a href="Listeners_SSL_Help.html">Listener SSL</a></li> <li><a href="Templates_Help.html">Virtual Host Templates</a></li> <li><a href="VirtualHosts_Help.html">Virtual Host Basic</a></li> <li><a href="VHGeneral_Help.html">Virtual Host General</a></li> <li><a href="VHSecurity_Help.html">Virtual Host Security</a></li> <li><a href="VHSSL_Help.html">Virtual Host SSL</a></li> <li><a href="Rewrite_Help.html">Rewrite</a></li> <li><a href="Context_Help.html">Context</a></li> <ul class="level3"> <li><a href="Static_Context.html">Static Context</a></li> <li> <a href="Java_Web_App_Context.html">Java Web App Context</a> </li> <li><a href="Servlet_Context.html">Servlet Context</a></li> <li><a href="FCGI_Context.html">Fast CGI Context</a></li> <li><a href="LSAPI_Context.html">LSAPI Context</a></li> <li><a href="Proxy_Context.html">Proxy Context</a></li> <li><span class="current"><a href="CGI_Context.html">CGI Context</a></span></li> <li><a href="LB_Context.html">Load Balancer Context</a></li> <li><a href="Redirect_Context.html">Redirect Context</a></li> <li><a href="App_Server_Context.html">App Server Context</a></li> <li><a href="Module_Context.html">Module Handler Context</a></li> </ul> <li><a href="VHWebSocket_Help.html">Web Socket Proxy</a></li> </ul> </li> <li><a href="webconsole.html">Web Console</a> <ul class="level2"> <li><a href="AdminGeneral_Help.html">Admin Console General</a></li> <li><a href="AdminSecurity_Help.html">Admin Console Security</a></li> <li> <a href="AdminListeners_General_Help.html"> Admin Listener General </a> </li> <li> <a href="AdminListeners_SSL_Help.html">Admin Listener SSL</a> </li> </ul> </li> </ul> </div> </aside> <article class="contentwrapper ls-col-3-5 clearfix"><div class="nav-bar ls-spacer-micro-top"><div class="prev">« <a href="Proxy_Context.html">Proxy Context</a></div><div class="center"><a href="Context_Help.html">Context</a></div><div class="next"><a href="LB_Context.html">Load Balancer Context</a> »</div></div> <h1>CGI Context</h1><h2 id="top">Table of Contents</h2><section class="toc"><section class="toc-row"><header><a href="#cgiContext">CGI Context</a></header><p> <a href="#expuri">URI</a> | <a href="#cgi_path">路径</a> | <a href="#extraHeaders">标头控制</a> | <a href="#allowSetUID">允许设置UID</a> | <a href="#realm">域</a> | <a href="#authName">认证名称</a> | <a href="#required">Require(授权的用户/组)</a> | <a href="#accessAllowed">允许访问列表</a> | <a href="#accessDenied">拒绝访问列表</a> | <a href="#extAuthorizer">Authorizer</a> | <a href="#addDefaultCharset">添加默认的字符集</a> | <a href="#defaultCharsetCustomized">自定义默认字符集</a> | <a href="#enableRewrite">启用重写</a> | <a href="#rewriteInherit">重写继承</a> | <a href="#rewriteBase">重写基准</a> | <a href="#rewriteRules">重写规则</a> | <a href="#enableIpGeo">启用IP地理定位</a></p></section> </section> <section><div class="helpitem"><article class="ls-helpitem"><div><header id="cgiContext"><h3>CGI Context<span class="ls-permlink"><a href="#cgiContext"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>A CGI context defines scripts in a particular directory as CGI scripts. This directory can be inside or outside of the document root. When a file under this directory is requested, the server will always try to execute it as a CGI script, no matter if it's executable or not. In this way, file content under a CGI Context is always protected and cannot be read as static content. It is recommended that you put all your CGI scripts in a directory and set up a CGI Context to access them.</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="expuri"><h3>URI<span class="ls-permlink"><a href="#expuri"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>Specifies the URI for this context.</p> <h4>Syntax</h4><p>指定此context下的URI。这个URI应该以"/"开始。 如果一个URI以"/"结束,那么该context将包含这个URI下的所有下级URI。如果context类型映射到系统目录上,则必须添加结尾的"/"</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#location">位置</a></span></p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="cgi_path"><h3>路径<span class="ls-permlink"><a href="#cgi_path"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定CGI脚本的位置.</p> <h4>Syntax</h4><p>The path can be a directory that contains a group of CGI scripts, like <span class="val">$VH_ROOT/myapp/cgi-bin/</span>. In this case, the context <span class="tagl"><a href="#expuri">URI</a></span> must end with "/", like <span class="val">/app1/cgi/</span>. The Path can also specify only one CGI script, like <span class="val">$VH_ROOT/myapp/myscript.pl</span>. This script should have the corresponding <span class="tagl"><a href="#expuri">URI</a></span> <span class="val">/myapp/myscript.pl</span>.</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="extraHeaders"><h3>标头控制<span class="ls-permlink"><a href="#extraHeaders"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定要添加的附加响应/请求头。可以添加每行一个来添加多个头指令。"NONE "可以用来禁止父头继承。如果没有提供,则假定为 "Header"。</p> <h4>Syntax</h4><p>[Header]|RequestHeader [condition] set|append|merge|add|unset header [value] [early|env=[!]variable]</p> <h4>例子</h4><div class="ls-example">set Cache-control no-cache<br/> append Cache-control no-store<br/> Header set My-header cust_header_val<br/> RequestHeader set My-req-header cust_req_header_val</div><h4>提示</h4><p><span title="Information" class="ls-icon-info"></span> 语法和用法类似于 <a href="https://httpd.apache.org/docs/2.2/mod/mod_headers.html#header" target="_blank" rel="noopener noreferrer">Apache's mod_headers directives</a><br/><br/> <span title="Information" class="ls-icon-info"></span> The 'Header' directive is is optional and can be excluded or left in when copying rules from elsewhere without issue.</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="allowSetUID"><h3>允许设置UID<span class="ls-permlink"><a href="#allowSetUID"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定CGI脚本是否允许设置UID。如果允许,并且为CGI脚本启用了设置UID,那么无论CGI脚本是代表哪个用户启动的,CGI进程的用户ID都将切换为CGI脚本所有者的用户ID。<br/>默认值是 "关"</p> <h4>Syntax</h4><p>从单选框选择</p> <h4>提示</h4><p>[安全建议] 尽可能不要允许CGI脚本设置UID,因为这存在着安全风险</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="realm"><h3>域<span class="ls-permlink"><a href="#realm"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定这个context下的realm授权。 当指定时,必须提供有效的用户和用户名来访问这个context。 <span class="tagl"><a href="VHSecurity_Help.html#realms">Realms授权</a></span>需要在<span class="tagP"><a href="#VHSecurity_Help">虚拟主机安全</a></span>部分进行设置。 此设置使用每个realm的<span class="tagl"><a href="VHSecurity_Help.html#realmName">域名称</a></span>。</p> <h4>Syntax</h4><p>从列表中选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="authName"><h3>认证名称<span class="ls-permlink"><a href="#authName"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>为当前context下的realm认证指定一个替代的名称。 如果没有指定,原realm名称将被使用。 认证名称将显示在浏览器登陆弹出窗口。</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="required"><h3>Require(授权的用户/组)<span class="ls-permlink"><a href="#required"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定哪些用户/用户组可以访问此context。 这里允许你使用一个用户/组数据库(在 <span class="tagl"><a href="#realm">域</a></span>中指定)访问多个context, 但只允许该数据库下特定的用户/组访问这个context。</p> <h4>Syntax</h4><p>Syntax is compatible with Apache's Require directive. For example: <ul> <li><span class="val">user username [username ...]</span><br/> Only listed users can access this context.</li> <li> <span class="val">group groupid [groupid ...]</span><br/> Only users belonging to the listed groups can access this context.</li> </ul> If this setting is not specified, all valid users will be allowed to access this resource.</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="accessAllowed"><h3>允许访问列表<span class="ls-permlink"><a href="#accessAllowed"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定允许访问这个context下资源的IP地址或子网。综合 <span class="tagl"><a href="#accessDenied">拒绝访问列表</a></span>项的配置以及服务器/虚拟主机级别访问控制, 可访问性将以客户端IP所符合的最小范围来确定。</p> <h4>Syntax</h4><p>Comma-delimited list of IPs/sub-networks.</p> <h4>例子</h4><div class="ls-example">网络可以写成<span class="val">192.168.1.0/255.255.255.0</span>, <span class="val">192.168.1</span> 或<span class="val">192.168.1.*</span>。</div></article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="accessDenied"><h3>拒绝访问列表<span class="ls-permlink"><a href="#accessDenied"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定哪个IP地址或子网不被允许访问这个context下的资源。 综合<span class="tagl"><a href="#accessAllowed">允许访问列表</a></span>项的配置以及服务器/虚拟主机级别访问控制, 可访问性将以客户端IP所符合的最小范围来确定。</p> <h4>Syntax</h4><p>Comma-delimited list of IPs/sub-networks.</p> <h4>例子</h4><div class="ls-example">子网络可以写成<span class="val">192.168.1.0/255.255.255.0</span>, <span class="val">192.168.1</span> 或<span class="val">192.168.1.*</span>。</div></article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="extAuthorizer"><h3>Authorizer<span class="ls-permlink"><a href="#extAuthorizer"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定可用于生成授权/未授权 decisions的外部应用程序。 目前,仅FastCGI授权器可用。 有关FastCGI授权者角色的更多详细信息, 请访问<a href="https://fastcgi-archives.github.io/" target="_blank" rel="noopener noreferrer">https://fastcgi-archives.github.io/</a>。</p> <h4>Syntax</h4><p>从列表中选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="addDefaultCharset"><h3>添加默认的字符集<span class="ls-permlink"><a href="#addDefaultCharset"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>S指定当内容类型是"text/html"或"text/plain"且没有参数时,是否添加字符集标记到"Content-Type"响应报头中。当设置为<span class="val">Off</span>时,该功能禁用。当设置为<span class="val">On</span>时,将添加<span class="tagl"><a href="#defaultCharsetCustomized">自定义默认字符集</a></span>中指定的字符集,如果没有指定,将添加默认的"iso-8859-1"字符集。</p> <h4>Syntax</h4><p>从单选框选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="defaultCharsetCustomized"><h3>自定义默认字符集<span class="ls-permlink"><a href="#defaultCharsetCustomized"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定一个字符集当<span class="tagl"><a href="#addDefaultCharset">添加默认的字符集</a></span>是<span class="val">On</span>时使用。这是可选的。默认值是<span class="val">iso-8859-1</span>。当<span class="tagl"><a href="#addDefaultCharset">添加默认的字符集</a></span>是<span class="val">Off</span>时本设置将不生效。</p> <h4>Syntax</h4><p>Name of a character set.</p> <h4>例子</h4><div class="ls-example">utf-8</div></article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="enableRewrite"><h3>启用重写<span class="ls-permlink"><a href="#enableRewrite"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定是否启用LiteSpeed的URL重写. 可以在虚拟主机或context级别上自定义此选项, 并且沿目录树继承该选项,直到被其他选项覆。</p> <h4>Syntax</h4><p>从单选框选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="rewriteInherit"><h3>重写继承<span class="ls-permlink"><a href="#rewriteInherit"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定是否从父级context继承重写规则。 如果启用重写但不继承,将启用本context的重写基准及重写规则。</p> <h4>Syntax</h4><p>从单选框选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="rewriteBase"><h3>重写基准<span class="ls-permlink"><a href="#rewriteBase"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定重写规则的基准URL。</p> <h4>Syntax</h4><p>URL</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="rewriteRules"><h3>重写规则<span class="ls-permlink"><a href="#rewriteRules"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定虚拟主机级别的重写规则。<br/><br/> 请勿在此处添加任何目录级重写规则。 如果您在.htaccess有任何目录级的重写规则,则应该使用uri"/"创建一个静态context, 并在那里添加重写规则。 <br/><br/> 重写规则由一个<span class="val">RewriteRule</span>组成,并可可以在多个<span class="val">RewriteCond</span>之后。 <ul> <li>每行仅能有一条规则</li> <li> <span class="val">RewriteCond</span> 和 <span class="val">RewriteRule</span> 遵循Apache的rewrite语法。 只需从Apache配置文件中复制并粘贴重写规则即可。 </li> <li> LiteSpeed和Apache mod_rewrite之间有细微差别: <ul> <li> <span class="val">%\{LA-U:variable\}</span> and <span class="val">%\{LA-F:variable\}</span> 在Litespeed 重写中将被忽略 </li> <li> Litespeed中加入了两个新变量: <span class="val">%\{CURRENT_URI\}</span>表示正在处理的URL <span class="val">%\{SCRIPT_NAME\}</span>表示为相应的CGI环境变量。 </li> <li> Litespeed在遇到<span class="val">[L]</span>后为了避免循环将停止处理此及此后的重写规则 而Apache mod_rewrite将仅停止处理该条重写规则。此行为类似于apachemod_rewrite中的<span class="val">[END]</span>标志。 </li> </ul> </li> </ul><br/> LiteSpeed的重写规则遵循Apache的重写规范。 有关重写规则的更多详细信息,请参阅 <a href=" http://httpd.apache.org/docs/current/mod/mod_rewrite.html " target="_blank" rel="noopener noreferrer"> Apache's mod_rewrite document(英文文档) </a> 和 <a href=" http://httpd.apache.org/docs/current/rewrite/ " target="_blank" rel="noopener noreferrer"> Apache's URL rewriting guide(英文文档) </a>.</p> <h4>Syntax</h4><p>string</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="enableIpGeo"><h3>启用IP地理定位<span class="ls-permlink"><a href="#enableIpGeo"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定是否启用IP地理定位查找。 可以在服务器级别,虚拟主机级别,或context级别设置。</p> <h4>Syntax</h4><p>从单选框选择</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="ServGeneral_Help.html#useIpInProxyHeader">使用报头中的客户端IP</a></span>, <span class="tagl"><a href="ServGeneral_Help.html#geoipDBFile">数据库文件路径</a></span>,</p> </article> </div> </section> </article><div class="ls-col-1-1"><footer class="copyright">Copyright © 2013-2020. <a href="https://www.litespeedtech.com">LiteSpeed Technologies Inc.</a> 版权所有.</footer> </div></div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings