<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">

<!-- ========================================================================= -->
<!-- This file configures the Jetty server.                                    -->
<!-- All changes require a restart of I2P.                                     -->
<!--                                                                           -->
<!-- Commonly changed settings:                                                -->
<!--   * host: Change 127.0.0.1 to 0.0.0.0 in the addListener section          -->
<!--           to access the server directly (bypassing i2p)                   -->
<!--           from other computers. The included version of Jetty has         -->
<!--           been patched to allow IPv6 addresses as well,                   -->
<!--           enclosed in brackets e.g. [::1]                                 -->
<!--   * port: Default 7658 in the addListener section                         -->
<!--   * threads: Raise MaxThreads in the addListener section                  -->
<!--           if you have a high-traffic site and get a lot of warnings.      -->
<!--   * Uncomment the addWebApplications section to use to enable             -->
<!--           war files placed in the webapps/ dir.                           -->
<!--   * Uncomment the line to allow Jetty to follow symlinks                  -->
<!--                                                                           -->
<!-- I2P uses Jetty 5.1.15. We have no plans to upgrade to Jetty 6, due to     -->
<!-- the significant changes in the API. If you need web server features not   -->
<!-- found in Jetty 5, you may install and run Jetty 6 in a different JVM,     -->
<!-- or run any other web server such as Apache. If you do run another         -->
<!-- web server instead, be sure and disable the Jetty 5 server for your       -->
<!-- eepsite on http://127.0.0.1/configclients.jsp .                           -->
<!--                                                                           -->
<!-- Jetty errors and warnings will appear in wrapper.log, check there         -->
<!-- to diagnose problems.                                                     -->
<!--                                                                           -->
<!-- Note that the XML encoding for this file is UTF-8.                        -->
<!--                                                                           -->
<!-- If you have a 'split' directory installation, with configuration          -->
<!-- files in ~/.i2p (Linux) or %APPDATA%\I2P (Windows), be sure to            -->
<!-- edit the file in the configuration directory, NOT the install directory.  -->
<!--                                                                           -->
<!-- ========================================================================= -->

<!-- =============================================================== -->
<!-- Configure the Jetty Server                                      -->
<!-- =============================================================== -->
<Configure class="org.mortbay.jetty.Server">

  <!-- =============================================================== -->
  <!-- Configure the Request Listeners                                 -->
  <!-- =============================================================== -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a HTTP listener to port 8080                  -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Arg>
          <New class="org.mortbay.util.InetAddrPort">
            <Set name="host">127.0.0.1</Set>
            <Set name="port">7658</Set>
          </New>
        </Arg>
        <Set name="MinThreads">3</Set>
        <Set name="MaxThreads">10</Set>
        <Set name="MaxIdleTimeMs">60000</Set>
        <Set name="LowResourcePersistTimeMs">1000</Set>
        <Set name="ConfidentialPort">8443</Set>
        <Set name="IntegralPort">8443</Set>
        <Set name="PoolName">main</Set>
      </New>
    </Arg>
  </Call>



  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add a HTTPS SSL listener on port 8443                           -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SunJsseListener">
        <Set name="Port">8443</Set>
        <Set name="PoolName">main</Set>
        <Set name="Keystore"><SystemProperty name="jetty.home" default="."/>/etc/demokeystore</Set>
	<Set name="Password">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
	<Set name="KeyPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
        <Set name="NonPersistentUserAgent">MSIE 5</Set>
      </New>
    </Arg>
  </Call>
  -->

  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add a AJP13 listener on port 8009                               -->
  <!-- This protocol can be used with mod_jk in apache, IIS etc.       -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.ajp.AJP13Listener">
        <Set name="PoolName">ajp</Set>
        <Set name="Port">8009</Set>
        <Set name="MinThreads">3</Set>
        <Set name="MaxThreads">20</Set>
        <Set name="MaxIdleTimeMs">0</Set>
        <Set name="confidentialPort">443</Set>
      </New>
    </Arg>
  </Call>
  -->


  <!-- =============================================================== -->
  <!-- Uncomment this to allow Jetty to follow symlinks                -->
  <!-- Jetty declares this to be a security risk, use with care        -->
  <!-- See also http://docs.codehaus.org/display/JETTY/How+to+enable+serving+aliased+files -->
  <!-- =============================================================== -->
  <!-- UNCOMMENT TO ACTIVATE
  <Set name="checkAliases" class="org.mortbay.util.FileResource" type="boolean">false</Set>
  -->


  <!-- =============================================================== -->
  <!-- Configure the Contexts                                          -->
  <!-- =============================================================== -->


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add a all web application within the webapps directory.         -->
  <!-- + No virtual host specified                                     -->
  <!-- + Look in the webapps directory relative to jetty.home or .     -->
  <!-- + Use the default webdefault.xml in jetty's install             -->
  <!-- + Upack the war file                                            -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Set name="rootWebApp">root</Set>
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addWebApplications">
    <Arg></Arg>
    <Arg>./eepsite/webapps/</Arg>
    <Arg></Arg>
    <Arg type="boolean">true</Arg>
  </Call>
  -->


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Add and configure a specific web application                    -->
  <!-- + Set Unpack WAR files                                          -->
  <!-- + Set Default Descriptor.  Resource, file or URL                -->
  <!-- + Set Virtual Hosts. A Null host or empty array means all hosts -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- UNCOMMENT TO ACTIVATE
  <Call name="addWebApplication">
    <Arg>/context</Arg>
    <Arg>./webapps/root</Arg>

    <Set name="extractWAR">false</Set> 

    <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>

    <Set name="virtualHosts">
      <Array type="java.lang.String">
        <Item></Item>
        <Item>127.0.0.1</Item>
        <Item>localhost</Item>
        <Item>www.acme.com</Item>
      </Array>
    </Set>
  </Call>
  -->

  <Call name="addContext">
    <Arg>
      <New class="org.mortbay.http.HttpContext">
        <Set name="contextPath">/</Set>
        <Set name="resourceBase">./eepsite/docroot</Set>
        <Call name="addHandler">
          <Arg>
            <New class="org.mortbay.http.handler.ResourceHandler">
              <Set name="redirectWelcome">FALSE</Set>
              <!-- disable TRACE and OPTIONS ref: http://osdir.com/ml/java.jetty.support/2003-11/msg00014.html -->
              <Set name="AllowedMethods">
                <Array type="String">
                  <Item>GET</Item>
                  <Item>HEAD</Item>
                  <Item>POST</Item>
                </Array>
              </Set>
	    </New>
          </Arg>
        </Call>
      </New>
    </Arg>
  </Call>
  
  <Call name="addContext">
    <Arg>/cgi-bin/*</Arg>
    <Set name="ResourceBase">./eepsite/cgi-bin</Set>
    <Call name="addServlet">
      <Arg>Common Gateway Interface</Arg>
      <Arg>/</Arg>
      <Arg>org.mortbay.servlet.CGI</Arg>
     <Put name="Path">/usr/local/bin:/usr/ucb:/bin:/usr/bin</Put>
    </Call>
  </Call>

  <!-- =============================================================== -->
  <!-- Configure the Request Log                                       -->
  <!-- =============================================================== -->
  <Set name="RequestLog">
    <New class="org.mortbay.http.I2PRequestLog">
      <Arg>./eepsite/logs/yyyy_mm_dd.request.log</Arg>
      <Set name="retainDays">90</Set>
      <Set name="append">true</Set>
      <Set name="extended">false</Set>
      <Set name="buffered">false</Set>
      <Set name="LogTimeZone">GMT</Set>
    </New>
  </Set>

  <!-- =============================================================== -->
  <!-- Configure the Other Server Options                              -->
  <!-- =============================================================== -->
  <Set name="requestsPerGC">2000</Set>
<!--  defaults to false, requires access through jconsole?
  <Set name="statsOn">false</Set>
-->

</Configure>
