HEX
Server: LiteSpeed
System: Linux ip-172-31-76-142.ec2.internal 4.14.158-129.185.amzn2.x86_64 #1 SMP Tue Dec 24 03:15:32 UTC 2019 x86_64
User: 69b4844ae61d4e92bf26ad98af552775 (1065)
PHP: 7.2.27
Disabled: exec,passthru,shell_exec,system,eval
Upload Files
File: //usr/local/lsws/docs/zh-CN/VirtualHosts_Help.html
<!DOCTYPE html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <title>Open LiteSpeed Web Server Users' Manual - Virtual Hosts Basic</title>
  <meta name="description" content="Open LiteSpeed Web Server Users' Manual - Virtual Hosts Basic." />
  <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>
  <h3 class="ls-text-thin">OpenLiteSpeed Web Server <a href="index.html"> Users' Manual</a></h3>
  <h5 class="ls-text-muted">Version 1.6 &nbsp;&#8212;&nbsp;Rev. 2</h5>
  <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>
        </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><span class="current"><a href="VirtualHosts_Help.html">Virtual Host Basic</a></span></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><a href="CGI_Context.html">CGI Context</a></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">&#171 <a href="Templates_Help.html">Virtual Host Templates</a></div><div class="center"><a href="config.html">Configuration</a></div><div class="next"><a href="VHGeneral_Help.html">Virtual Host General</a> &#187;</div></div>
<h1>Virtual Hosts Basic</h1><section class="ls-spacer-small-bottom">This page lists all defined virtual hosts. From here you can add/delete a virtual host or make
changes to an existing one. Before you add a virtual host, make sure the virtual host root directory exists.</section>
<h2 id="top">Table of Contents</h2><section class="toc"><section class="toc-row"><header>Base</header><p>
<a href="#vhName">虚拟主机名</a> | <a href="#vhRoot">虚拟主机根</a> | <a href="#configFile">配置文件</a></p></section>
<section class="toc-row"><header>Connection</header><p>
<a href="#vhMaxKeepAliveReq">最大Keep-Alive请求数</a> | <a href="#vhSmartKeepAlive">智能Keep-Alive</a></p></section>
<section class="toc-row"><header>Security</header><p>
<a href="#allowSymbolLink">跟随符号链接</a> | <a href="#enableScript">启用脚本</a> | <a href="#restrained">访问管制</a> | <a href="#setUidMode">外部应用程序设置UID模式</a> | <a href="#suexecUser">suEXEC User</a> | <a href="#suexecGroup">suEXEC Group</a></p></section>
<section class="toc-row"><header>Virtual Host</header><p>
<a href="#staticReqPerSec">静态请求/秒</a> | <a href="#dynReqPerSec">Dynamic Requests/Second</a> | <a href="#outBandwidth">出口带宽</a> | <a href="#inBandwidth">入口带宽</a></p></section>
</section>
<section><div class="helpitem"><article class="ls-helpitem"><div><header id="vhName"><h3>虚拟主机名<span class="ls-permlink"><a href="#vhName"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>为虚拟主机的唯一名称。建议使用虚拟主机的域名作为虚拟主机名。 虚拟主机名参数可以使用$VH_NAME变量来引用。</p> <h4>Syntax</h4><p>文本</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="vhRoot"><h3>虚拟主机根<span class="ls-permlink"><a href="#vhRoot"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定虚拟主机的根目录。 注:这<b>不是</b>目录根。 建议将所有与该虚拟主机相关的文件 (像日志文件,html文件,CGI脚本等)都放置在这个目录下。 虚拟主机根参数可以使用$VH_ROOT变量来引用。</p> <h4>Syntax</h4><p>路径2</p> <h4>Tips</h4><p>[性能建议] 在不同的硬盘放置不同的虚拟主机。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="configFile"><h3>配置文件<span class="ls-permlink"><a href="#configFile"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定虚拟主机的配置文件名称。 配置文件必须位于$SERVER_ROOT/conf/vhosts/目录下。 推荐使用<span class="val">$SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf</span>。</p> <h4>Syntax</h4><p>文件3</p> <h4>Tips</h4><p><span title="Information" class="ls-icon-info"></span> $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf is recommended</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="vhMaxKeepAliveReq"><h3>最大Keep-Alive请求数<span class="ls-permlink"><a href="#vhMaxKeepAliveReq"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定通过keep-alive(永久)连接服务的最大请求数量。当该限制值达到时连接将被断开。你可以为不同虚拟主机设置不同的数值。这个数值不能超过服务器级别的<span class="tagl"><a href="ServTuning_Help.html#maxKeepAliveReq">最大持续连接请求数</a></span>限制值。</p> <h4>Syntax</h4><p>无符号整数</p> <h4>Tips</h4><p>[性能建议] 设置为一个合理的高数值。设置为1或比1更小的值将禁用keep-alive连接。</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="ServTuning_Help.html#maxKeepAliveReq">最大持续连接请求数</a></span></p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="vhSmartKeepAlive"><h3>智能Keep-Alive<span class="ls-permlink"><a href="#vhSmartKeepAlive"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定是否为虚拟主机启用智能Keep-Alive。这个选项仅在当<span class="tagl"><a href="ServTuning_Help.html#smartKeepAlive">智能持续连接</a></span>启用并且<span class="tagl"><a href="#vhMaxKeepAliveReq">最大Keep-Alive请求数</a></span>大于1的时候生效。</p> <h4>Syntax</h4><p>布尔值</p> <h4>Tips</h4><p>[性能建议] 为访问繁忙的网站启用此项。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="allowSymbolLink"><h3>跟随符号链接<span class="ls-permlink"><a href="#allowSymbolLink"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定在这个虚拟主机内是否要跟随符号链接。 <span class="val">If Owner Match</span>选项启用后,只有在链接和目标属主一致时才跟踪符号链接。 此设置将覆盖默认的服务器级设置。</p> <h4>Syntax</h4><p>选项</p> <h4>Tips</h4><p>[性能和安全性建议] 为了更好的安全性,请禁用此功能。为了获得更好的性能,启用它。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="enableScript"><h3>启用脚本<span class="ls-permlink"><a href="#enableScript"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定在这个虚拟主机中是否允许运行脚本(非静态页面)。 如果禁用,CGI, FastCGI, LSAPI, Servlet引擎 和其他脚本语言都将在这个虚拟机中不被允许使用。 因此如果你希望使用一个脚本处理程序,你需要启用本项。</p> <h4>Syntax</h4><p>布尔值</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="restrained"><h3>访问管制<span class="ls-permlink"><a href="#restrained"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定虚拟机根($VH_ROOT)以外的文件是否可以通过这个网站访问。 如果设置是<span class="val">Yes</span>,只可以访问$VH_ROOT下的文件, 访问指向$VH_ROOT以外文件或目录的符号链接或context指向都将被阻止。 尽管如此,这里不会限制CGI脚本的访问。 这个选项在共享主机下非常有用。 <span class="tagl"><a href="#allowSymbolLink">跟随符号链接</a></span>可以设置成<span class="val">Yes</span>来允许用户使用在$VH_ROOT下的符号链接, $VH_ROOT以外的则不可以。</p> <h4>Syntax</h4><p>布尔值</p> <h4>Tips</h4><p>[安全建议] 在共享主机环境下打开该功能。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="setUidMode"><h3>外部应用程序设置UID模式<span class="ls-permlink"><a href="#setUidMode"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定如何为外部程序进程设置用户ID。可以选择下面三种方式: <ul><li><span class="val">Server UID</span>: 为外部应用程序设置与服务器用户/组ID相同的用户/组ID。</li>     <li><span class="val">CGI File UID</span>: 为外部应用CGI程序设置基于可执行文件的用户/组ID。该选项仅适用于CGI,不适用于FastCGI或LSPHP。</li>     <li><span class="val">Doc Root UID</span>: 为外部应用程序设置基于当前虚拟机根目录的用户/组ID。</li> </ul></p> <h4>Syntax</h4><p>选项</p> <h4>Tips</h4><p>[安全建议] 在共享主机环境中,建议使用<span class="val">CGI File UID</span>  或 <span class="val">Doc Root UID</span>模式来防止一个虚拟主机下的文件被另一个虚拟主机的外部应用程序访问。</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="suexecUser"><h3>suEXEC User<span class="ls-permlink"><a href="#suexecUser"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>At the current context level, run as this user. If set, this value will override the Virtual Host level <b>ExtApp Set UID Mode</b> setting.<br/><br/> This configuration may be overridden at the External Application level using the <b>Run As User</b> setting.<br/><br/> Default value: Not Set</p> <h4>Syntax</h4><p>Valid user name or uid.</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="suexecGroup"><h3>suEXEC Group<span class="ls-permlink"><a href="#suexecGroup"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>At the current context level, run as this group. Either <b>suEXEC User</b> at the Virtual Host level, or <b>Run As User</b> at the External Application level, must be set for <b>suEXEC Group</b> to take effect.<br/><br/> This configuration can be overridden at the External Application level using the <b>Run As Group</b> setting.<br/><br/> Default value: <b>suExec User</b> setting value</p> <h4>Syntax</h4><p>Valid group name or uid</p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="staticReqPerSec"><h3>静态请求/秒<span class="ls-permlink"><a href="#staticReqPerSec"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定每秒可处理的来自单个IP的静态内容请求数量(无论与该IP之间建立了多少个连接)。<br/><br/> 当达到此限制时,所有后来的请求将被延滞到下一秒。 对于动态内容请求的限制与本限制无关。 每个客户端的请求限制可以在服务器或虚拟主机级别设置。 虚拟主机级别的设置将覆盖服务器级别的设置。</p> <h4>Syntax</h4><p>无符号整数</p> <h4>Tips</h4><p>[安全] 受信任的IP或子网不受影响。</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#dynReqPerSec">Dynamic Requests/Second</a></span></p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="dynReqPerSec"><h3>Dynamic Requests/Second<span class="ls-permlink"><a href="#dynReqPerSec"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>Specifies the maximum number of requests to dynamically generated content  coming from a single IP address that can be processed in each second regardless of the number of connections established.  When this limit is reached, all future requests to dynamic content  are tar-pitted until the next second. <br/><br/> The request limit for static content is independent of this limit. This per client request limit can be set at server or virtual host level.  Virtual host-level settings override server-level settings.</p> <h4>Syntax</h4><p>无符号整数</p> <h4>Tips</h4><p><span title="Security" class="ls-icon-security"></span> Trusted IPs or sub-networks are not restrained by this limit.</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#staticReqPerSec">静态请求/秒</a></span></p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="outBandwidth"><h3>出口带宽<span class="ls-permlink"><a href="#outBandwidth"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定对单个IP地址允许的最大传出吞吐量(无论与该IP之间建立了多少个连接)。 为提高效率,真正的带宽可能最终会略高于设定值。 带宽按4KB为单位分配。设定值为<span class="val">0</span>可禁用限制。 每个客户端的带宽限制(字节/秒)可以在服务器或虚拟主机级别设置。 虚拟主机级别的设置将覆盖服务器级别的设置。</p> <h4>Syntax</h4><p>无符号整数</p> <h4>Tips</h4><p>[性能建议] 按8KB单位设置带宽可获得更好的性能。<br/> [安全建议] 受信任的IP或子网不受影响。</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#inBandwidth">入口带宽</a></span></p> </article> </div>
<div class="helpitem"><article class="ls-helpitem"><div><header id="inBandwidth"><h3>入口带宽<span class="ls-permlink"><a href="#inBandwidth"></a></span><span class="top"><a href="#top">&#8657;</a></span></h3></header></div><h4>Description</h4><p>指定对单个IP地址允许的最大传入吞吐量(无论与该IP之间建立了多少个连接)。 为提高效率,真正的带宽可能最终会略高于设定值。 带宽是按1KB单位分配。设定值为<span class="val">0</span>可禁用限制。 每个客户端的带宽限制(字节/秒)可以在服务器或虚拟主机级别设置。 虚拟主机级别的设置将覆盖服务器级别的设置。</p> <h4>Syntax</h4><p>无符号整数</p> <h4>Tips</h4><p>[安全] 受信任的IP或子网不受影响。</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#outBandwidth">出口带宽</a></span></p> </article> </div>
</section>
</article><div  class="ls-col-1-1"><footer class="copyright">Copyright &copy; 2013-2018. <a href="https://www.litespeedtech.com">LiteSpeed Technologies Inc.</a> All rights reserved.</footer>
</div></div>
</body>
</html>