File manager - Edit - /usr/local/lswsbak/docs/zh-CN/Java_Web_App_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 - Java Web App Context</title> <meta name="description" content="OpenLiteSpeed Users' Manual - Java Web App 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> <span class="current"><a href="Java_Web_App_Context.html">Java Web App Context</a></span> </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">« <a href="Static_Context.html">Static Context</a></div><div class="center"><a href="Context_Help.html">Context</a></div><div class="next"><a href="Servlet_Context.html">Servlet Context</a> »</div></div> <h1>Java Web App Context</h1><h2 id="top">Table of Contents</h2><section class="toc"><section class="toc-row"><header><a href="#javaWebAppContext">Java Web App Context</a></header><p> <a href="#uri">URI</a> | <a href="#javaWebApp_location">伪造</a> | <a href="#javaServletEngine">Servlet Engine</a> | <a href="#enableExpires">启用过期</a> | <a href="#expiresDefault">默认过期</a> | <a href="#expiresByType">按类型过期</a> | <a href="#extraHeaders">标头控制</a> | <a href="#autoIndex">自动索引</a> | <a href="#indexFiles">索引文件</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="#enableIpGeo">启用IP地理定位</a></p></section> </section> <section><div class="helpitem"><article class="ls-helpitem"><div><header id="javaWebAppContext"><h3>Java Web App Context<span class="ls-permlink"><a href="#javaWebAppContext"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>Many people running Java applications use the servlet engine to serve static content as well. But no servlet engine is nearly as efficient as LiteSpeed Web Server for these processes. In order to improve the overall performance, LiteSpeed Web Server can be configured as a gateway server, which serves static content and forwards dynamic Java page requests to the servlet engine.<br/><br/> LiteSpeed Web Server requires certain contexts to be defined in order to run a Java application. A Java Web App Context automatically creates all required contexts based on the Java web application's configuration file (WEB-INF/web.xml).<br/><br/> There are a few points you need to keep in mind when setting up a Java Web App Context:<br/> <ul> <li>A <span class="val">Servlet Engine</span> external application must be set up in <span class="tagP"><a href="#ExtApp_Help">外部应用</a></span> before Java Web App Context can be set up.</li> <li>A <span class="tagP"><a href="#ScriptHandler_Help">脚本处理程序</a></span> for .jsp files should be defined as well.</li> <li>If the web application is packed into a .war file, the .war file must be expanded. The server cannot access compressed archive files.</li> <li>For the same resources, the same URL should be used no matter whether it is accessed through LiteSpeed Web Server or through the servlet engine's built-in HTTP server.<br/> For example, Tomcat 4.1 is installed under /opt/tomcat. Files for the "examples" web application are located at /opt/tomcat/webapps/examples/. Through Tomcat's built-in HTTP server, the "examples" web application is thus accessed with a URI like "/examples/***". The corresponding Java Web App Context should thus be configured: <span class="tagl"><a href="#expuri">URI</a></span> = <span class="val">/examples/</span>, <span class="tagl"><a href="#javaWebApp_location">伪造</a></span> = <span class="val">/opt/tomcat/webapps/examples/</span>.</li> </ul></p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="uri"><h3>URI<span class="ls-permlink"><a href="#uri"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定此context下的URI。这个URI应该以"/"开始。 如果一个URI以"/"结束,那么该context将包含这个URI下的所有下级URI。</p> <h4>Syntax</h4><p>URI</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="javaWebApp_location"><h3>伪造<span class="ls-permlink"><a href="#javaWebApp_location"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定包含此Web应用程序的目录。 应包含以下文件 "WEB-INF/web.xml".<br/><br/> 默认值:$DOC_ROOT + <span class="tagl"><a href="#uri">URI</a></span></p> <h4>Syntax</h4><p>path</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="javaServletEngine"><h3>Servlet Engine<span class="ls-permlink"><a href="#javaServletEngine"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定为该Web应用程序提供服务的Servlet Engine的名称。 Servlet引擎必须在服务器或虚拟主机级别的<span class="tagP"><a href="#ExtApp_Help">外部应用</a></span>中定义。</p> <h4>Syntax</h4><p>从列表中选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="enableExpires"><h3>启用过期<span class="ls-permlink"><a href="#enableExpires"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定是否为静态文件生成Expires头。如果启用,将根据 <span class="tagl"><a href="#expiresDefault">默认过期</a></span>和<span class="tagl"><a href="#expiresByType">按类型过期</a></span>生成Expires头。<br/><br/> 这可以在服务器,虚拟主机和Context级别设置。低级别的设置将 覆盖高级别的设置。例如,Context级别的设置将覆盖虚拟主机级别的设置, 虚拟主机级别的设置将覆盖服务器级别的设置。</p> <h4>Syntax</h4><p>从单选框选择</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="expiresDefault"><h3>默认过期<span class="ls-permlink"><a href="#expiresDefault"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定生成Expires头的默认设置。该设置在<span class="tagl"><a href="#enableExpires">启用过期</a></span> 设为“启用”时有效。它可以被<span class="tagl"><a href="#expiresByType">按类型过期</a></span>覆盖。 除非必要,否则不要在服务器或虚拟主机级别设置该默认值。 因为它会为所有网页生成Expires头。大多数时候,应该是 为不常变动的某些目录在Context级别设置。如果没有默认设置,<span class="tagl"><a href="#expiresByType">按类型过期</a></span>中未指定的类型不会生成Expires头。</p> <h4>Syntax</h4><p>A|Mseconds<br/> 文件将在基准时间(A|M)加指定秒数的时间后失效。 “A”代表基准时间为客户端的访问时间,“M”代表文件的最后修改时间。</p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="expiresByType"><h3>按类型过期<span class="ls-permlink"><a href="#expiresByType"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>为各个MIME类型分别指定Expires头设置。</p> <h4>Syntax</h4><p>逗号分隔的“MIME-类型=A|M秒数”的列表。 文件将在基准时间(A|M)加指定秒数的时间后失效。<br/><br/> “A”代表基准时间为客户端的访问时间,“M”代表文件的最后修改时间。 MIME-类型可使用通配符“*”,如image/*。</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="autoIndex"><h3>自动索引<span class="ls-permlink"><a href="#autoIndex"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>在目录中,当<span class="tagl"><a href="#indexFiles">索引文件</a></span>中所列的索引文件不可用时,指定运行时是否即时生成目录索引。<br/> 此选项可以在虚拟主机级别和context级别中设置,并可以顺着目录树继承,直到被覆盖。 您可以自定义生成的索引页面。请访问在线百科了解如何操作。</p> <h4>Syntax</h4><p>从单选框选择</p> <h4>提示</h4><p>[安全建议] 建议关闭自动索引,从而尽可能防止泄露机密数据。</p> <h4>See Also</h4><p class="ls-text-small"><span class="tagl"><a href="#indexFiles">索引文件</a></span>, <span class="tagl"><a href="#autoIndexURI">自动索引URI</a></span></p> </article> </div> <div class="helpitem"><article class="ls-helpitem"><div><header id="indexFiles"><h3>索引文件<span class="ls-permlink"><a href="#indexFiles"></a></span><span class="top"><a href="#top">⇑</a></span></h3></header></div><h4>Description</h4><p>指定URL映射到目录时顺序查找的索引文件名称。 您可以在服务器、虚拟主机和Context级别对其进行自定义。</p> <h4>Syntax</h4><p>Comma-delimited list of index filenames.</p> <h4>提示</h4><p>[性能建议] 只设置你需要的索引文件。</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="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