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

📄 install-apache.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 2 页
字号:
<p>Create a test file '/usr/local/apache/htdocs/test.jsp'</p><example>2 + 2 = &lt;%= 2 + 2 %&gt;</example><p>Browse http://localhost/test.jsp again.  You should now get</p><results>2 + 2 = 4</results></s1><s1 name="httpd.conf" title="Configuring Apache httpd.conf"><p>The installation process above automatically changes the httpd.conf file.You can also configure the httpd.conf file manually, or modify thedefault configuration created by the installation process.</p><example title="Unix - httpd.conf">LoadModule caucho_module libexec/mod_caucho.soResinConfigServer localhost 6800&lt;Location /caucho-status&gt;  SetHandler caucho-status&lt;/Location&gt;</example><example title="Windows - httpd.conf">LoadModule caucho_module \    &lt;installdir&gt;/resin-3.2.x/libexec/apache-2.0/mod_caucho.dllResinConfigServer localhost 6800&lt;Location /caucho-status&gt;  SetHandler caucho-status&lt;/Location&gt;</example><p>The <code>ResinConfigServer</code> is used to tell mod_caucho how to contactthe backend Resin server.  The backend Resin server tell's mod_caucho which urlsshould be dispatched.</p><deftable><tr><th>Apache Command</th><th>Meaning</th></tr><tr><td>ResinConfigServer <var>host</var> <var>port</var></td><td>Specifies the Resin JVM at <var>host:port</var> as a configuration server.</td></tr></deftable><s2 name="caucho-status" title="caucho-status"><p><code>caucho-status</code> is optional and probably should be avoided ina production site.  It lets you ask the Caucho Apache module about it'sconfiguration, and the status of the backend server(s), valuable fordebugging.</p><p>After any change to httpd.conf, restart Apache.  Now browsehttp://localhost/caucho-status.</p></s2><s2 name="manual-dispatch" title="Manual configuration of dispatching"><p>You can also dispatch to Resin directly from the httpd.conf.  Instead ofrelying on the ResinConfigServer directive to determine which url's to dispatchto the backend server, Apache handler's are used to specify the url's todispatch.</p><example>CauchoHost 127.0.0.1 6800&lt;Location /foo/*&gt;  SetHandler caucho-request&lt;/Location&gt;</example><deftable><tr>  <th width="30%">Apache Command</th>  <th>Meaning</th></tr><tr>  <td>CauchoHost <var>host</var> <var>port</var></td>  <td>Alternative to <var>ResinConfigServer</var>, adds the Resin JVM with an server port at host:port as a backend server.</td></tr><tr>  <td>CauchoBackup <var>host</var> <var>port</var></td>  <td>Alternative to <var>ResinConfigServer</var>, adds the Resin JVM with  a server port at host:port as a backup backend server.</td></tr></deftable><deftable><tr>  <th width="30%">Apache Handler</th>  <th>Meaning</th></tr><tr>  <td>caucho-status</td>  <td>Handler to display /caucho-status</td></tr><tr>  <td>caucho-request</td>  <td>Dispatch a request to Resin</td></tr></deftable><p>Requests dispatched directly from the Apache httpd.conf will notappear in /caucho-status.</p></s2>  <!-- manual-dispatch --></s1>  <!-- httpd.conf --><s1 name="vhosts" title="Virtual Hosts"><p>The <a href="virtual-host.xtp">virtual host</a> topic describes virtualhosts in detail.  If you're using a single JVM, you only need to configurethe resin.xml.</p><example title="httpd.conf">LoadModule caucho_module libexec/mod_caucho.soResinConfigServer 192.168.0.1 6800&lt;Location /caucho-status&gt;  SetHandler caucho-status&lt;/Location&gt;</example><example title="resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;&lt;cluster id="app-tier"&gt;  &lt;server id="" address="192.168.0.1" port="6800"/&gt;  &lt;host id='www.gryffindor.com'&gt;    &lt;host-alias&gt;gryffindor.com&lt;/host-alias&gt;     ...  &lt;/host&gt;  &lt;host id='www.slytherin.com'&gt;    &lt;host-alias&gt;slytherin.com&lt;/host-alias&gt;     ...  &lt;/host&gt;&lt;/cluster&gt;&lt;/resin&gt;</example><s2 name="vhostperjvm" title="Virtual Host per JVM"><p>If you want a different JVM for each virtual host, yourhttpd.conf can specify a different server port for each host.</p><example title="httpd.conf">&lt;VirtualHost gryffindor.com&gt;ServerName gryffindor.comServerAlias www.gryffindor.comResinConfigServer 192.168.0.1 6800&lt;/VirtualHost&gt;&lt;VirtualHost slytherin.com&gt;ServerName slytherin.comServerAlias www.slytherin.comResinConfigServer 192.168.0.1 6801&lt;/VirtualHost&gt;</example><example title="gryffindor.conf">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;&lt;cluster id=""&gt;  &lt;server id="" address="192.168.0.1" port="6800"/&gt;  &lt;host id=""&gt;     ...  &lt;/host&gt;&lt;/cluster&gt;&lt;/resin&gt;</example><example title="slytherin.conf">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;&lt;cluster&gt;  &lt;server id="" address="192.168.0.1" port="6801"/&gt;  &lt;host id=""&gt;     ...  &lt;/host&gt;&lt;/cluster&gt;&lt;/resin&gt;</example><example>$ bin/resin.sh -pid gryffindor.pid -conf conf/gryffindor.conf start$ bin/resin.sh -pid slytherin.pid -conf conf/slytherin.conf start...$ bin/resin.sh -pid gryffindor.pid stop</example></s2> <!-- vhostperjvm --></s1>  <!-- vhosts --><s1 name="balance" title="Load Balancing"><p>The <a href="resin-clustering.xtp">Reliability and Load Balancing</a>section provides an introduction to the concepts of load balancing.</p><p>mod_caucho recognizes cluster configurations for load balancing. Requests are distributed to all machines in the cluster, allrequests in a session will go to the same host, and if one host goes down,Resin will send the request to the next available machine.Optional backup machines only receive requests if all of the primaries aredown.</p><example title="resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="app-tier"&gt;    &lt;server id="a" address="192.168.0.11" port="6800" index="1"/&gt;    &lt;server id="b" address="192.168.0.11" port="6801" index="2"              backup="true"/&gt;    &lt;server id="c" address="192.168.0.12" port="6800" index="3"/&gt;    &lt;server id="d" address="192.168.0.12" port="6801" index="4"              backup="true"/&gt;    ...  &lt;/cluster&gt;&lt;/resin&gt;</example><p>mod_caucho only needs to know about one of the backend servers. It will querythat backend server, and learn about all of the other members of the cluster.</p><example>ResinConfigServer 192.168.0.11 6800</example><p>mod_caucho keeps a local cache of the configuration information, so if thebackend server becomes unavailable then the cached configuration will be useduntil the backend server becomes available again.</p><p>The httpd.conf file can also specify more than one backend server, whenmod_caucho checks for configuration updates, it will check each in turn, andonly if none of them are available will it use the local cached copy.</p><example>ResinConfigServer 192.168.0.11 6800ResinConfigServer 192.168.0.12 6801</example><s2 name="manual-dispatch-balance" title="Manual configuration of load balanced dispatching"><p>Manual dispatching in httpd.conf can also specify the backend hosts and the backend backup hosts, as an alternative to using <code>ResinConfigServer</code>.</p><example>CauchoHost 192.168.0.11 6800CauchoBackup 192.168.0.11 6801CauchoHost 192.168.0.12 6800CauchoBackup 192.168.0.12 6801&lt;Location /foo/*&gt;  SetHandler caucho-request&lt;/Location&gt;</example></s2> <!-- manual-dispatch-balance --><s2 name="manual-dispatch-location" title="Manual configuration of location based dispatching"><example>&lt;Location /applicationA/*&gt;  ResinConfigServer 192.168.0.11 6800&lt;/Location&gt;&lt;Location /applicationB/*&gt;  ResinConfigServer 192.168.0.12 6800&lt;/Location&gt;</example></s2> <!-- manual-dispatch-location --></s1> <!-- balance --><s1 title="Troubleshooting"><ol><li>First, check your configuration with Resin standalone.sh.In other words, add a &lt;http port='8080'/&gt; and check port 8080.</li><li>Check http://localhost/caucho-status.  That will tell ifmod_caucho has properly connected to the backend Resin server.</li><li>Each server should be green and the mappings shouldmatch your resin.xml.</li><li>If caucho-status fails entirely, the problem is in the mod_cauchoinstallation and the Apache httpd.conf.</li><li>If caucho-status shows the wrong mappings, there's something wrongwith the resin.xml or the pointer to the backend server in httpd.conf.</li><li>If caucho-status shows a red servlet runner, then Resin hasn'tproperly started.</li><li>If you get a "cannot connect to servlet engine", caucho-statuswill show red, and Resin hasn't started properly.</li><li>If Resin doesn't start properly, you should look at the logsin resin-3.2.x/log.  You should start <var>resin.sh -verbose</var> or<var>resin.exe -verbose</var> to get more information.</li><li>If Resin never shows a "hmux listening to *:6800" line,it's not listening for connections from mod_caucho. You'll need to add a &lt;server&gt; line.</li><li>If you get Resin's "file not found", the Apache configurationis good but the resin.xml probably points to the wrong directories.</li></ol></s1>  </body></document>

⌨️ 快捷键说明

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