<document>
  <header>
    <product>resin</product>
    <title>How To</title>
    <version>Resin 3.0</version>
    <description>
      <p>Task-based configuration index.</p>
    </description>
  </header>

  <body>

<summary/>

<faq title="Configure and use a database connection">

<p>See
the <a href="db|config">database configuration page</a> for the full
configuration documentation.

<p>See the <a href="db|thirdparty">thirdparty driver configuration page</a> for
sample configurations for several database drivers.</p>

<p>See the
<a href="db|tutorial/jdbc-basic/index">JNDI DataSource tutorial</a>
and the <a href="db|tutorial/jdbc-ioc/index">DataSource
inversion-of-control tutorial</a> for sample JDBC usage patterns.</p>

</faq>

<faq title="Bind to port 80/443 without running as root">

<p>Unix needs root privileges to bind to port 80 and 443, but Resin should
avoid running as root for security.  It's best to use a port mapper
or firewall to map the protected port to an unprotected port
like 8080 to avoid running as root entirely.</p>

<p>On Linux, use iptables.  <a href="scrapbook.xtp">An example iptable configuration.</a></p>

<p>If iptables is not available, the <a href="config|resin.xtp#user-name">user-name</a> and <a href="config|resin.xtp#group-name">group-name</a>
configuration can use setuid to change Resin's user after binding ports.
</p>

</faq>

<faq title="Set a proxy port when mapping port 80 to port 8080">

<p>When the HTTP port is mapped from 80 to port 8080 or when a load balancer
redirects to an internal IP address, the application often needs
the external address, not the server's view.</p>

<p>Use <a href="resin.xtp#server-name">host-name</a> in the &lt;host>
to set the canonical host and port name to the external address.</p>

<example>
&lt;host host-name="http://foo.com:80">
  &lt;host-alias>foo.com&lt;/host-alias>
  ...
&lt;/host>
</example>

</faq>

<faq title="Reload .war files manually">

<p>See the <a href="jmx|cookbook/restart.xtp">JMX restart</a> example.</p>

</faq>

  </body>
</document>
