<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:id="Firewall-usage" xml:lang="en"
         xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:mml="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <title>Configuring RMI for use through a Firewall</title>
  </info>

  <para>By default, the RMI protocol in JOnAS uses a random port at each
  startup, which implies that there is no way to configure a firewall as the
  port number changes each time the system restarts.</para>

  <para>However you can easily configure the RMI port number by setting only
  one property per protocol in the
  <code>$JONAS_BASE/conf/carol.properties</code> file.</para>

  <para>To configure the RMI exported-port number, edit the
  <code>$JONAS_BASE/conf/carol.properties</code> file to change the following
  protocols from 0 (choose a random port number) to the port number you
  want:</para>

  <itemizedlist>
    <listitem>
      <para>For the RMI/JRMP protocol, change: <screen>carol.jrmp.server.port=0</screen></para>
    </listitem>

    <listitem>
      <para>For the RMI/IRMI protocol, change: <screen>carol.irmi.server.port=0</screen></para>
    </listitem>

    <listitem>
      <para>For the RMI/IIOP protocol, change: <screen>carol.iiop.server.port=0</screen></para>
    </listitem>
  </itemizedlist>
</chapter>
