⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 http-config.xtp

📁 解压在c盘
💻 XTP
📖 第 1 页 / 共 2 页
字号:
<defun title='srun' version='Resin 1.1'><p>Defines multiple client machines for load balancing.  Thisdirective used by the web server (Apache or IIS) and by the Java portionof Resin.</p><p>Each <var/srun/> directive adds a new client to receive loadbalanced requests.  With Resin 1.2, the resin.conf must have at leastone &lt;srun> or &lt;http> element.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>id<td>srun identifier name.<td>none<tr><td>host<td>The host name of the client srun.<td>all interfaces<tr><td>port<td>The port name of the client srun.<td>none<tr><td>connect-timeout<td>How long to wait for a connection from theweb server to the Resin srun before giving up.<td>30 sec<tr><td>live-time<td>How long the web-server/srun connection should stay live.<td>10 sec<tr><td>dead-time<td>How long before checking that a srun has come back up.<td>5 sec<tr><td>timeout<td>How long the load balancing server should wait for a response.<td>30 sec<tr><td>thread-max<td>Maximum number of live threads.<td>200<tr><td>thread-min<td>Minimum number of live threads.<td>5<tr><td>thread-keepalive<td>Number of keepalive threads<td>100<tr><td>request-timeout<td>Max time for a request, after this the requestwill be interrupted.<td>30 sec<tr><td>listen<td>Value of the socket listen parameter<td>5<tr><td>accept-buffer-size<td>Number of sockets in the accept buffer.<td>256<tr><td>shutdown-wait-time<td>How long to wait for connections tofinish before exiting.<td>10 sec.</deftable><example title='Load balance over three machines'>&lt;caucho.com&gt;  &lt;http-server&gt;    &lt;srun id='a' host='host1.caucho.com' port='6802'&gt;    &lt;srun id='b' host='host2.caucho.com' port='6802'&gt;    &lt;srun id='c' host='host2.caucho.com' port='6803'&gt;  &lt;/http-server&gt;&lt;/caucho.com&gt;</example><p>To start srun 'a' use a command line like</p><example>unix> <var/srun.sh -server a/>Resin 2.1.0srun listening to host1.caucho.com:6802</example><p>On Unix, when starting a daemon, you'll need to specify a unique pid file.</p><example>unix> <var/srun.sh -server a -pid a.pid start/></example></defun><defun title='srun-backup' version='Resin 1.1'><p>Defines backup client machines for load balancing.  Thisdirective is only picked up by the load balancer.  TheJava portion of Resin treats a &lt;srun-backup> like any other srun.Normally, &lt;srun-backup> is only used when each web server hasa primary &lt;srun> in preference to other &lt;srun> JVMs.See the <a href="balance.xtp">load-balancing</a> sectionfor more information.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>id<td>srun identifier name<td>none<tr><td>host<td>The host name of the client srun<td>all interfaces<tr><td>port<td>The port name of the client srun<td>none<tr><td>connect-timeout<td>How long to wait for a connection from theweb server to the Resin srun before giving up.<td>30 sec<tr><td>live-time<td>How long a keepalive connection will remain alive beforeclosing.<td>5 sec.<tr><td>dead-time<td>How long to treat a non-responding srun before trying again.<td>5 sec.<tr><td>shutdown-wait-time<td>How long to wait for connections tofinish before exiting.<td>10 sec.</deftable></defun><defun title='thread-keepalive'><p>Number of threads to be used in keepalive requests.  WhenResin is used in combination with a web server, like Apache or IIS,Resin will reuse the socket connection to that web server ifpossible.  <var/thread-keepalive/> specifies the number of theads thatcan be used in these keepalive connections.</p><p>Defaults to 100.</p></defun><defun title='thread-max'><p>Maximum number of request-handling threads.</p><p>Defaults to 200.</p></defun></s2><!--   - host section  --><s2 title='host'><defun title='access-log'><p>Specifies the access log file.  The log is relative to$RESIN_HOME.  You can use the special path <var/$app-dir/> to makethe log relative to the host, e.g. <var/$app-dir/WEB-INF/log/access.log/>.</p><deftable><tr><th>Attribute<th>Description<th>Default<tr><td>id<td>The access log path.<td>required<tr><td>format<td>Access log format.<td>see below<tr><td>class-name<td>Class implementing AbstractAccessLog for custom logging.<tr><td>rollover-period<td>how often to rollover the log.Normally in days (15D), weeks (2W) or months (1M).<td>none<tr><td>rollover-size<td>max size of the log before a rollover.<td>10 meg<tr><td>archive-format<td>format the name of the archive file.<td>n/a</deftable><p>The <var/rollover-period/> variable controls how often the access logwill be rotated.  When the time runs out, Resin will move the old logfile to a timestamped one, e.g. access.log20001114.  Rollovers happenat midnight in the local time if the time period is a day or longer.</p><p>The access log formatting variables follow the Apache variables:</p><deftable><tr><td>%b<td>result content length<tr><td>%h<td>remote IP addr<tr><td>%{<var/xxx/>}i<td>request header <var/xxx/><tr><td>%{<var/xxx/>}o<td>response header <var/xxx/><tr><td>%{<var/xxx/>}c<td>cookie value <var/xxx/><tr><td>%n<td>request attribute<tr><td>%r<td>request URL<tr><td>%s<td>status code<tr><td>%{<var/xxx/>}t<td>request date with optional time format string.<tr><td>%T<td>time of request in seconds<tr><td>%u<td>remote user<tr><td>%U<td>request URI</deftable><p>The default format is:</p><def>"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""</def><example>&lt;host id=''>  &lt;access-log id='log/access.log'&gt;    &lt;rollover-period>2W&lt;/rollover-period>  &lt;/access-log> ...&lt;/host&gt;</example><p>If the web-app doesn't specify an access-log, it will use the host'saccess-log.</p></defun><defun title='doc-dir' version="Resin 2.1"><p>Specifies the document directory for the &lt;host>or &lt;http-server>.</p><p>&lt;doc-dir> values may use use system properties,like <var/$server.root/> or <var/$resin.home/> or even <var/$foo/>.</p><example>&lt;host id=''&gt;  &lt;doc-dir>/opt/web/default_host&lt;/doc-dir> ...&lt;/host&gt;</example><p><b>Default:</b> Defaults to &lt;root-dir> if specified.  Otherwise&lt;host> defaults to the document directory of the &lt;http-server>&lt;http-server> defaults to the server-root.</p></defun><defun title='root-dir' version="Resin 2.1"><p>Specifies the root directory for the &lt;host>or &lt;http-server>.  Non-document data like log filesand war directories are based off the root directory.</p><p>&lt;root-dir> values may use use system properties,like <var/$server.root/> or <var/$resin.home/> or even <var/$foo/>.</p><example>&lt;host id=''&gt;  &lt;root-dir>/opt/web/default_host&lt;/root-dir>  &lt;doc-dir>doc&lt;/doc-dir> ...&lt;/host&gt;</example><p><b>Default:</b> Hosts defaults to the &lt;root-dir> ofthe &lt;http-server>.  &lt;http-server> defaults to the server-root.</p></defun><defun title=session-cookie version="Resin 2.1.2"><p>Configures session cookie.  The default is "JSESSIONID".</p></defun><defun title=session-url-prefix version="Resin 2.0"><p>Configures the URL prefix to be used for url-rewriting.  Thedefault is ";jsessionid=".</p></defun><defun title='server-name' version='Resin 2.0.4'><p>Defines the canonical url for the host. In some cases, thespecific URL that's used for a virtual host might be different from the &lt;host id='...'> name.  &lt;server-name> lets you specify the exact URL to be added when using a sendRedirect.</p><example>...&lt;host id='foo.com'>  &lt;server-name>http://foo.com&lt;/server-name>  ...&lt;/host>...</example></defun><defun title=server-listener version="Resin 2.0.3"><p>Specifies the classname for a listener when the server starts andshuts down.  The class must be in the system classpath becauseit's called before the dynamic classpaths have been created and afterthey've been destroyed.</p><p>The server listener class must extendcom.caucho.http.admin.AbstractServerListener.</p><example>&lt;http-server>  &lt;server-listener>    &lt;class-name>test.MyListener&lt;/class-name>  &lt;/server-listener>  ...</example></defun><defun title=servlet-classloader-hack version="Resin 2.0.3"><p>Enables the Servlet specification classloader hack.The Servlet 2.3 classloader order violates the JDKclassloader specification.  By default, therefore, Resin follows theJDK requirements.  Those application which need to violate the JDK specmay enable the servlet-classloader-hack.</p><p>By default, the hack is disabled.</p></defun><defun title=sticky-sessions version="Resin 2.0"><p>Enables or disables sticky-session load balancing.</p><p>The default is true to enable sticky sessions.</p></defun><defun title='url-character-encoding'><p>Defines the character encoding to be used for decoding theURL.  Because the HTTP protocol does not specify the encoding tobe used, the server must specify the encoding beforehand.</p><p><b>Default: </b> utf-8</p></defun><defun title='url-length-max'><p>Specifies the maximum length allowed in a HTTP URL.  Requests withlonger lengths will receive an error.</p><p><b>Default: </b> 8192</p></defun><defun title='war-dir'><p>Specifies a special directory to place war files.  Any .war(web-application resource) file placed in the war directory will beautomatically expanded and installed.  The .war file will be expandedinto <var/war-expand-dir/>, if specified.</p><p>The war-dir is relative to $RESIN_HOME, not to the virtual host'sapp-dir.</p><example>&lt;host id='www.foo.com'>  &lt;war-dir>foo-apps&lt;/war-dir>&lt;/host></example><p>Given the above example, if you put foo.war in resin1.2/foo-apps, Resinwill automatically expand it and install it with the prefix <var//foo/>.So browsing <var/http://localhost:8080/foo/> will give the top-level contents.</p><p>Generally, war files use <var/WEB-INF/web.xml/> for configuration.  Thesyntax is the same as for other application configuration.</p><p>No war-dir is defined by default.</p></defun><defun title='war-expand-dir' version='Resin 1.2.3'><p>Specifies the destination of war expansion.  Any .war(web-application resource) file placed in the war-dir directory will beautomatically expanded into war-expand-dir.  You can also create a web-appby creating a directory in war-expand-dir.</p><p>The war-dir is relative to $RESIN_HOME, not to the virtual host'sapp-dir.</p><p>The special directory <var/ROOT/> lets you define the root web-app.</p><p>Generally, war files use <var/WEB-INF/web.xml/> for configuration.  Thesyntax is the same as for other application configuration.</p><p><b>Default:</b> Defaults to the value of &lt;war-dir>.</p></defun><defun title='web-app'><p>Specifies an application.  Applications are self-containedsubtrees of the web site.  They have distinct Application objects,sessions, and servlet mappings.  Applications can even be deployedentirely from .jar files.</p><p>The full <a href='app-config.xtp'>application configuration</a> isdescribed in a separate page.</p><p>Applications have a root <var/app-dir/> similar to the document root.By default, it's just the same as the relative path.</p><p>Beneath the <var/app-dir/> root, a special directory <var/WEB-INF/>contains servlet classes and beans.  <var/WEB-INF/classes/> contains Javasource files and Java classes. <var/WEB-INF/lib/> contains additionaljar files for the application.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>id<td>The url prefix of the application.<td>required<tr><td>url-regexp<td>A regular expression matching a url prefix.<td>none<tr><td>app-dir<td>The application's root directory.<td>The subdirectory ofthe host's app-dir named by <var/id/></deftable><example>&lt;host id='foo.com'&gt;&lt;web-app id='example/tictactoe'         app-dir='c:\work\ttt'&gt;  &lt;servlet-mapping url-pattern='*.foo'                      servlet-name='com.caucho.jsp.XtpServlet'/&gt;&lt;/web-app&gt;&lt;/host&gt;</example><p>The <var/url-regexp/> configuration allows for dynamic applications,for example, creating a new application for each user.</p><example title="Per-user Servlet Directory">&lt;host&gt;&lt;web-app url-regexp='^/~([^/]+)'         app-dir='/home/$1/public_html'&gt;  ...&lt;/web-app&gt;&lt;/host&gt;</example><p>In the above example, users will put their own web.xmlin <var//home/user/public_html/WEB-INF/web.xml/>.  Classes belongin <var/public_html/WEB-INF/classes/>.</p><note>Only the Resin Java process understands regexps.  Because mod_caucho,isapi_srun and the other web server plugins don't understand the regexps,you may need to do additional work to make the web server send the requestto Resin.</note></defun></s2><s2 title='Formal Description'><def>http-server ::= <a href="#http">http</a>,                <a href="#srun">srun</a>,                <a href="#srun-backup">srun-backup</a>,                <a href="#thread-max">thread-max</a>,                <a href="#thread-min">thread-min</a>,                <a href="#thread-keepalive">thread-keepalive</a>,                <a href="#request-timeout">request-timeout</a>,                <a href="#ping">ping</a>,                <a href="#alternate-session-url-prefix">alternate-session-url-prefix</a>,                <a href="#session-url-prefix">session-url-prefix</a>,                <a href="#sticky-sessions">sticky-sessions</a>,                <a href="#ignore-client-disconnect">ignore-client-disconnect</a>,                <a href="#global-system-properties">global-system-properties</a>,                <a href="#root-dir">root-dir</a>,                <a href="#doc-dir">doc-dir</a>,                <a href="#cache">cache</a>,                <a href="#host">host</a>*,                <var/default host or web-app tags/>*</def></s2></s1>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -