<!-- SurveyXact - resin.conf -->
<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core">

  <management>
    <user name="xxx" password="xxx"/>
  </management>

  <stdout-log path="/usr/local/www/xact/logs/resin-stdout.log" timestamp="[%Y-%m-%d %H:%M:%S.%s]" rollover-period="1D"/>
  <stderr-log path="/usr/local/www/xact/logs/resin-stderr.log" timestamp="[%Y-%m-%d %H:%M:%S.%s]" rollover-period="1D"/>

  <log name="" level="config" path="stdout:" timestamp="[%H:%M:%S.%s] "/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>
  <logger name="com.caucho.server.port" level="finer"/>

  <dependency-check-interval>5</dependency-check-interval>

  <cluster id="web">
    <server-default>
      <jvm-arg>-Xms10g</jvm-arg>
      <jvm-arg>-Xmn1g</jvm-arg>
      <jvm-arg>-Xmx10g</jvm-arg>
      <jvm-arg>-server</jvm-arg>
      <jvm-arg>-Djava.awt.headless=true</jvm-arg>
      <jvm-arg>-XX:+DoEscapeAnalysis</jvm-arg>
      <jvm-arg>-XX:+UseCompressedOops</jvm-arg>
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
      <jvm-arg>-XX:CMSInitiatingOccupancyFraction=60</jvm-arg>
      <jvm-arg>-XX:SurvivorRatio=16</jvm-arg>
      <jvm-arg>-XX:MaxTenuringThreshold=1</jvm-arg>
      <jvm-arg>-XX:+PrintGCTimeStamps</jvm-arg>
      <jvm-arg>-XX:+PrintGCDateStamps</jvm-arg>
      <jvm-arg>-XX:+PrintGCDetails</jvm-arg>
      <jvm-arg>-XX:SoftRefLRUPolicyMSPerMB=1000</jvm-arg>
      <jvm-arg>-XX:-OmitStackTraceInFastThrow</jvm-arg>
      <jvm-arg>-XX:+HeapDumpOnOutOfMemoryError</jvm-arg>
      <jvm-arg>-XX:PermSize=128m</jvm-arg>
      <jvm-arg>-XX:MaxPermSize=128m</jvm-arg>
    </server-default>

    <server id="xact" address="127.0.0.1" port="7856">
        <watchdog-port>8856</watchdog-port>

        <thread-max>512</thread-max>
        <thread-idle-min>10</thread-idle-min>
        <thread-idle-max>20</thread-idle-max>

        <keepalive-max>800</keepalive-max>
        <keepalive-timeout>10s</keepalive-timeout>

        <load-balance-connect-timeout>5s</load-balance-connect-timeout>
        <load-balance-recover-time>15s</load-balance-recover-time>
        <socket-timeout>60s</socket-timeout>

        <bind-ports-after-start>true</bind-ports-after-start>
    </server>

    <ignore-client-disconnect>true</ignore-client-disconnect>

    <host id="" root-directory="/usr/local/www/xact">
      <class-loader>
         <compiling-loader path="site/WEB-INF/classes"/>
         <library-loader path="site/WEB-INF/lib"/>
      </class-loader>
      <access-log path="/usr/local/www/xact/logs/resin-access.log" 
          format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' 
          rollover-period="1D"/>
      <stdout-log path="/usr/local/www/xact/logs/resin-web-stdout.log"
          timestamp="[%Y-%m-%d %H:%M:%S.%s]" rollover-period="1D"/>
      <stderr-log path="/usr/local/www/xact/logs/resin-web-stderr.log"
          timestamp="[%Y-%m-%d %H:%M:%S.%s]" rollover-period="1D"/>
      <web-app id="/" document-directory="site">

        <jsp>
          <dependency-check-interval>5</dependency-check-interval>
        </jsp>

        <resin:import path="WEB-INF/web.xml"/>

        <session-config>
          <session-max>16384</session-max>
          <enable-cookies>true</enable-cookies>
          <enable-url-rewriting>true</enable-url-rewriting>
        </session-config>

         <!-- Database -->
         <database jndi-name="XactDsReserved">
            <driver type="net.sourceforge.jtds.jdbc.Driver">
               <url>jdbc:jtds:sqlserver://surveydb3.survey-it.dk:1433/xact_HEAD</url>
               <user>xxx</user>
               <password>xxx</password>
            </driver>
            <max-connections>25</max-connections>
            <max-idle-time>30</max-idle-time>
         </database>

         <!-- Database -->
         <database jndi-name="XactDsRequest">
            <driver type="net.sourceforge.jtds.jdbc.Driver">
               <url>jdbc:jtds:sqlserver://surveydb3.survey-it.dk:1433/xact_HEAD</url>
               <user>xxx</user>
               <password>xxx</password>
            </driver>
            <max-connections>100</max-connections>
            <max-idle-time>30</max-idle-time>
         </database>

         <!-- Reference to SMTP relay server -->
         <resource jndi-name="XactMailSession">
            <type>javax.mail.Session</type>
            <init>
               <mail.transport.protocol>smtp</mail.transport.protocol>
               <mail.smtp.host>mail.survey-it.dk</mail.smtp.host>
            </init>
         </resource>

         <servlet servlet-name="resin-jsp" servlet-class="com.caucho.jsp.JspServlet">
            <init>
               <load-tld-on-init>false</load-tld-on-init>
               <page-cache-max>1024</page-cache-max>
            </init>
            <load-on-startup/>
         </servlet>

         <!-- invoker servlet for all standard WebPages and WebCommands-->
         <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>

         <servlet-mapping url-pattern="*.jsp" servlet-name="resin-jsp"/>

         <env-entry>
            <description>The host name used to reach this server instance.</description>
            <env-entry-name>ExternalServerHostName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>www.survey-xact.dk</env-entry-value>
         </env-entry>

         <env-entry>
            <description>The protocol used to reach this server instance.</description>
            <env-entry-name>ExternalServerProtocol</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>https</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Enable email sending</description>
            <env-entry-name>xact.email.start</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>true</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Path to cross-deployment instance store</description>
            <env-entry-name>XactLogStore</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>/usr/local/www/xact/data/instance-store</env-entry-value>
         </env-entry>

         <env-entry>
            <env-entry-name>XactDataFileStorePath</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>/storage/nfs/projects/xact/data-file-store</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Migration data output.</description>
            <env-entry-name>MigrationOutputDir</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>/usr/local/www/xact/data/migration</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Location af search-context</description>
            <env-entry-name>XactSearchContext</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>search-context</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Comma separated list of hostnames with a valid SSL certificate.</description>
            <env-entry-name>SSLEnabledHostNames</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>www.survey-xact.dk,offline.survey-xact.dk,www.survey-xact.no,offline.survey-xact.no,www.survey-xact.se,offline.survey-xact.se</env-entry-value>
         </env-entry>

         <env-entry>
            <description>Comma separated list of additional IP addresses that are valid for reaching this server instance.
            Any IP address resolved from SSLEnabledHostNames or the default host name will also be considered valid</description>
            <env-entry-name>AdditionalServerIPAddresses</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>217.195.184.80,217.195.184.81,217.195.184.82</env-entry-value>
         </env-entry>

         <cache-mapping url-pattern='*.gif' expires='24h'/>

         <system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
         <system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/>
         <system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>

       </web-app>
    </host>
  </cluster>
</resin>

