| Server IP : 202.155.9.250 / Your IP : 216.73.216.236 Web Server : LiteSpeed System : Linux srv339029361 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64 User : lucky4072 ( 1024) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/local/lsws/docs/zh-CN/ |
Upload File : |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>OpenLiteSpeed用户手册 - 脚本处理程序</title>
<meta name="description" content="OpenLiteSpeed用户手册 - 脚本处理程序." />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex">
<script>
(function () {
var theme = 'light';
var resolved = false;
try {
if (window.localStorage) {
var storedTheme = window.localStorage.getItem('hdoc.theme');
if (storedTheme === 'light' || storedTheme === 'dark') {
theme = storedTheme;
resolved = true;
}
}
} catch (err) {
}
if (!resolved && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
}
document.documentElement.setAttribute('data-theme', theme);
document.documentElement.style.colorScheme = theme;
}());
</script>
<link rel="shortcut icon" href="../img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="../css/hdoc.css">
<link rel="stylesheet" type="text/css" href="../css/hdoc-product-accent.css">
<script src="hdoc-search-index.js" defer></script>
<script src="../js/hdoc-search.js" defer></script>
</head>
<body>
<div class="doc-shell">
<header class="doc-topbar">
<a class="doc-brand" href="index.html" aria-label="OpenLiteSpeed用户手册">
<img src="../img/ols_logo.svg" alt="OpenLiteSpeed logo" />
<strong>OpenLiteSpeed用户手册</strong>
</a>
<div class="doc-actions">
<button class="doc-menu-toggle" type="button" aria-label="打开菜单" data-menu-toggle aria-expanded="false">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 12h18M3 6h18M3 18h18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
</button>
<form class="doc-search" role="search" data-empty="搜索页面和设置" data-no-results="未找到结果。">
<label class="sr-only" for="doc-search-input">搜索手册</label>
<div class="doc-search__box">
<input id="doc-search-input" type="search" autocomplete="off" placeholder="搜索页面和设置" aria-controls="doc-search-results" />
<button type="submit">搜索</button>
</div>
<div id="doc-search-results" class="doc-search__results" hidden></div>
</form>
</div>
<label class="doc-language"><select id="doc-language-switcher" name="doc_language" data-language-switcher aria-label="语言"><option value="../ScriptHandler_Help.html" data-lang="en-US">English</option><option value="../es-ES/ScriptHandler_Help.html" data-lang="es-ES">Español</option><option value="../de-DE/ScriptHandler_Help.html" data-lang="de-DE">Deutsch</option><option value="../fr-FR/ScriptHandler_Help.html" data-lang="fr-FR">Français</option><option value="../zh-CN/ScriptHandler_Help.html" data-lang="zh-CN" selected>简体中文</option><option value="../ja-JP/ScriptHandler_Help.html" data-lang="ja-JP">日本語</option></select></label>
<button class="doc-theme-toggle" type="button" aria-label="切换主题" data-theme-toggle data-theme-light-label="浅色模式" data-theme-dark-label="深色模式" title="切换主题">
<span class="doc-theme-toggle__icon" aria-hidden="true"></span>
</button>
</header>
<div class="doc-menu-backdrop" data-menu-backdrop></div>
<div class="pagewrapper" data-current-lang="zh-CN" data-supported-langs="["en-US","es-ES","de-DE","fr-FR","zh-CN","ja-JP"]"><aside class="sidetree"><div class="sidetree__masthead"><figure class="sidetree__figure"><img src="../img/ols_logo.svg" alt="OpenLiteSpeed logo" /></figure><div class="sidetree__identity"><a class="sidetree__manual-link" href="index.html">用户手册</a><div class="sidetree__version">Version 1.9 — Rev. 4</div></div></div><nav class="sidetree__nav" aria-label="目录"><ul class="sidetree__list">
<li><a href="license.html">许可协议</a></li>
<li><a href="intro.html">简介</a></li>
<li><a href="install.html">安装/卸载</a></li>
<li>
<a href="admin.html">管理</a>
<ul class="level2">
<li><a href="ServerStat_Help.html">服务管理器</a></li>
<li><a href="Real_Time_Stats_Help.html">实时统计</a></li>
</ul>
</li>
<li><a href="security.html">安全</a></li>
<li>
<a href="config.html">配置</a>
<ul class="level2">
<li><a href="ServGeneral_Help.html">服务器常规</a></li>
<li><a href="ServLog_Help.html">服务器日志</a></li>
<li><a href="ServTuning_Help.html">服务器调优</a></li>
<li><a href="ServSecurity_Help.html">服务器安全</a></li>
<li>
<a href="ExtApp_Help.html">外部应用</a>
<ul class="level3">
<li><a href="External_LSAPI.html">LSAPI应用</a></li>
<li><a href="External_WS.html">Web服务器(代理)</a></li>
<li><a href="External_FCGI.html">Fast CGI应用</a></li>
<li><a href="External_FCGI_Auth.html">Fast CGI授权器</a></li>
<li><a href="External_SCGI.html">Simple CGI应用</a></li>
<li><a href="External_Servlet.html">Servlet引擎</a></li>
<li><a href="External_PL.html">管道日志器</a></li>
<li><a href="External_LB.html">负载均衡器</a></li>
<li><a href="External_UWSGI.html">uWSGI</a></li>
</ul>
</li>
<li><a class="current" href="ScriptHandler_Help.html">脚本处理程序</a></li>
<li><a href="App_Server_Help.html">应用服务器设置</a></li>
<li><a href="Module_Help.html">模块配置</a></li>
<li><a href="Listeners_General_Help.html">监听器常规</a></li>
<li><a href="Listeners_SSL_Help.html">监听器SSL</a></li>
<li><a href="Templates_Help.html">虚拟主机模板</a></li>
<li><a href="VirtualHosts_Help.html">虚拟主机注册</a></li>
<li><a href="VHGeneral_Help.html">虚拟主机常规</a></li>
<li><a href="VHSecurity_Help.html">虚拟主机安全</a></li>
<li><a href="VHSSL_Help.html">虚拟主机SSL</a></li>
<li><a href="Rewrite_Help.html">重写</a></li>
<li>
<a href="Context_Help.html">上下文</a>
<ul class="level3">
<li><a href="Static_Context.html">静态上下文</a></li>
<li><a href="Java_Web_App_Context.html">Java Web应用上下文</a></li>
<li><a href="Servlet_Context.html">Servlet上下文</a></li>
<li><a href="FCGI_Context.html">Fast CGI上下文</a></li>
<li><a href="SCGI_Context.html">Simple CGI上下文</a></li>
<li><a href="LSAPI_Context.html">LSAPI上下文</a></li>
<li><a href="Proxy_Context.html">代理上下文</a></li>
<li><a href="CGI_Context.html">CGI上下文</a></li>
<li><a href="LB_Context.html">负载均衡上下文</a></li>
<li><a href="Redirect_Context.html">重定向上下文</a></li>
<li><a href="App_Server_Context.html">应用服务器上下文</a></li>
<li><a href="UWSGI_Context.html">uWSGI上下文</a></li>
<li><a href="Module_Context.html">模块处理程序上下文</a></li>
</ul>
</li>
<li><a href="VHWebSocket_Help.html">WebSocket代理</a></li>
</ul>
</li>
<li>
<a href="webconsole.html">Web控制台</a>
<ul class="level2">
<li><a href="AdminGeneral_Help.html">管理控制台常规</a></li>
<li><a href="AdminSecurity_Help.html">管理控制台安全</a></li>
<li><a href="AdminListeners_General_Help.html">管理监听器常规</a></li>
<li><a href="AdminListeners_SSL_Help.html">管理监听器SSL</a></li>
</ul>
</li>
</ul></nav></aside><article class="contentwrapper"><div class="nav-bar"><div class="prev">« <a href="ExtApp_Help.html">外部应用</a></div><div class="center"><a href="config.html">配置</a></div><div class="next"><a href="App_Server_Help.html">应用服务器设置</a> »</div></div>
<header class="doc-page-header"><h1>脚本处理程序</h1><div class="doc-page-intro">LiteSpeed Web Server支持所有脚本语言,包括Perl、PHP、Ruby、Python、Java等。使用这些不同语言编写的脚本必须交给相应的外部应用程序处理。 LiteSpeed Web Server使用脚本处理程序来决定脚本应交给哪个外部应用程序。这些脚本处理程序通过文件后缀将文件映射到外部应用程序。(实际上,后缀用于确定MIME 类型,然后再将该MIME类型映射到外部应用程序。)必须先在“外部应用程序”选项卡中设置外部应用程序,然后才能在脚本处理程序中选择使用。 <br /><br /> 您可以在服务器或虚拟主机级别设置脚本处理程序。除非在虚拟主机级别覆盖,否则服务器级脚本处理程序适用于所有虚拟主机。 虚拟主机级别的脚本处理程序仅适用于该虚拟主机。</div>
</header><section class="doc-toc" aria-labelledby="top"><header class="doc-toc__header"><h2 id="top">目录</h2></header><section class="doc-toc__row"><h3 class="doc-toc__heading">脚本处理程序定义</h3><ul class="doc-toc__links"><li><a href="#suffix">后缀</a></li><li><a href="#shType">处理器类型</a></li><li><a href="#shHandlerName">处理器名称</a></li></ul></section>
</section>
<section class="doc-content-flow"><div class="helpitem"><article class="ls-helpitem"><header class="ls-helpitem__header" id="suffix"><h3>后缀<span class="ls-permlink"><a href="#suffix"></a></span></h3></header><h4>描述</h4><p>指定将由此脚本处理程序处理的脚本文件后缀。后缀必须唯一。</p> <h4>语法</h4><p>逗号分隔列表,禁止使用句点“.”字符。</p> <h4>提示</h4><p><span class="ls-badge ls-badge--info">信息</span> 服务器会自动为列表中的第一个后缀添加特殊MIME类型(“application/x-httpd-[suffix]”)。 例如,会为后缀“php53”添加MIME类型“application/x-httpd-php53”。第一个之后的后缀需要在<span class="tagl"><a href="#mime">MIME设置</a></span>设置中配置。<br/> 尽管我们在此字段中列出了后缀,但是脚本处理程序使用MIME类型而非后缀来确定要处理的脚本。<br/> <span class="ls-badge ls-badge--performance">性能</span><span class="ls-badge ls-badge--security">安全</span> 仅指定确实需要的后缀。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><header class="ls-helpitem__header" id="shType"><h3>处理器类型<span class="ls-permlink"><a href="#shType"></a></span></h3></header><h4>描述</h4><p>指定处理这些脚本文件的外部应用程序类型。可用类型包括: <span class="val">LSAPI app</span>、<span class="val">网络服务器</span>、<span class="val">Fast CGI</span>、<span class="val">SCGI</span>、<span class="val">CGI</span>、<span class="val">Load balancer</span>、 <span class="val">Servlet引擎</span>、<span class="val">uWSGI</span>或<span class="val">模块处理器</span>。除<span class="val">CGI</span>和<span class="val">模块处理器</span> 处理器类型外,<span class="tagl"><a href="#shHandlerName">处理器名称</a></span>还必须设置为<span class="tagP"><a href="#ExtApp_Help">外部应用</a></span>部分中已预先定义的外部应用程序。</p> <h4>语法</h4><p>从列表中选择</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><header class="ls-helpitem__header" id="shHandlerName"><h3>处理器名称<span class="ls-permlink"><a href="#shHandlerName"></a></span></h3></header><h4>描述</h4><p>当处理器类型为LSAPI app、Web Server (Proxy)、Fast CGI、SCGI、Load balancer、 Servlet Engine或uWSGI时,指定处理脚本文件的外部应用程序名称。</p> <h4>语法</h4><p>从列表中选择</p> </article> </div>
</section>
</article></div><button class="doc-back-to-top" type="button" aria-label="返回顶部" data-back-to-top><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 19V5" /><path d="m6 11 6-6 6 6" /></svg><span class="sr-only">返回顶部</span></button><footer class="copyright">版权 © 2013-2026. <a href="https://www.litespeedtech.com">LiteSpeed Technologies Inc.</a> 版权所有。</footer>
</div>
</body>
</html>