c:\Program Files\Apache Group\tomcat4.1\conf\server.xml

2002.09.28 @san01 が、Apache との連携に絡んだ修正箇所です。
※太字以外はコメントです。

0001 <!-- Example Server Configuration File -->
0002 <!-- Note that component elements are nested corresponding to their
0003      parent-child relationships with each other -->
0004 
0005 <!-- A "Server" is a singleton element that represents the entire JVM,
0006      which may contain one or more "Service" instances.  The Server
0007      listens for a shutdown command on the indicated port.
0008 
0009      Note:  A "Server" is not itself a "Container", so you may not
0010      define subcomponents such as "Valves" or "Loggers" at this level.
0011  -->
0012 
0013 <Server port="8005" shutdown="SHUTDOWN" debug="0">
0014 
0015 
0016   <!-- Uncomment these entries to enable JMX MBeans support -->
0017   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
0018             debug="0"/>
0019   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
0020             debug="0"/>
0021 
0022   <!-- Global JNDI resources -->
0023   <GlobalNamingResources>
0024 
0025     <!-- Test entry for demonstration purposes -->
0026     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
0027 
0028     <!-- Editable user database that can also be used by
0029          UserDatabaseRealm to authenticate users -->
0030     <Resource name="UserDatabase" auth="Container"
0031               type="org.apache.catalina.UserDatabase"
0032        description="User database that can be updated and saved">
0033     </Resource>
0034     <ResourceParams name="UserDatabase">
0035       <parameter>
0036         <name>factory</name>
0037         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
0038       </parameter>
0039       <parameter>
0040         <name>pathname</name>
0041         <value>conf/tomcat-users.xml</value>
0042       </parameter>
0043     </ResourceParams>
0044 
0045   </GlobalNamingResources>
0046 
0047   <!-- A "Service" is a collection of one or more "Connectors" that share
0048        a single "Container" (and therefore the web applications visible
0049        within that Container).  Normally, that Container is an "Engine",
0050        but this is not required.
0051 
0052        Note:  A "Service" is not itself a "Container", so you may not
0053        define subcomponents such as "Valves" or "Loggers" at this level.
0054    -->
0055 
0056   <!-- Define the Tomcat Stand-Alone Service -->
0057   <Service name="Tomcat-Standalone">
0058 
0059     <!-- A "Connector" represents an endpoint by which requests are received
0060          and responses are returned.  Each Connector passes requests on to the
0061          associated "Container" (normally an Engine) for processing.
0062 
0063          By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
0064          You can also enable an SSL HTTP/1.1 Connector on port 8443 by
0065          following the instructions below and uncommenting the second Connector
0066          entry.  SSL support requires the following steps (see the SSL Config
0067          HOWTO in the Tomcat 4.0 documentation bundle for more detailed
0068          instructions):
0069          * Download and install JSSE 1.0.2 or later, and put the JAR files
0070            into "$JAVA_HOME/jre/lib/ext".
0071          * Execute:
0072              %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
0073              $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
0074            with a password value of "changeit" for both the certificate and
0075            the keystore itself.
0076 
0077          By default, DNS lookups are enabled when a web application calls
0078          request.getRemoteHost().  This can have an adverse impact on
0079          performance, so you can disable it by setting the
0080          "enableLookups" attribute to "false".  When DNS lookups are disabled,
0081          request.getRemoteHost() will return the String version of the
0082          IP address of the remote client.
0083     -->
0084 
0085     <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
0086 
0087 <!-- //@sannomiya 2002.9.28 comment for apache server ok
0088 
0089     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
0090 port="8080"               minProcessors="5" maxProcessors="75"
0091                enableLookups="true" redirectPort="8443"
0092                acceptCount="10" debug="0" connectionTimeout="20000"
0093                useURIValidationHack="false" />
0094 
0095 -->
0096 
0097 
0098     <!-- Note : To disable connection timeouts, set connectionTimeout value 
0099      to -1 -->
0100 
0101     <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
0102     <!--
0103     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
0104                port="8443" minProcessors="5" maxProcessors="75"
0105                enableLookups="true"
0106                acceptCount="10" debug="0" scheme="https" secure="true"
0107                useURIValidationHack="false">
0108       <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
0109                clientAuth="false" protocol="TLS" />
0110     </Connector>
0111     -->
0112 
0113     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
0114     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
0115                port="8009" minProcessors="5" maxProcessors="75"
0116                enableLookups="true" redirectPort="8443"
0117                acceptCount="10" debug="0" connectionTimeout="20000"
0118                useURIValidationHack="false"
0119                protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
0120 
0121     <!-- Define an AJP 1.3 Connector on port 8009 -->
0122     <!--
0123     <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
0124                port="8009" minProcessors="5" maxProcessors="75"
0125                acceptCount="10" debug="0"/>
0126     -->
0127 
0128     <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
0129     <!-- See proxy documentation for more information about using this. -->
0130     <!--
0131     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
0132                port="8082" minProcessors="5" maxProcessors="75"
0133                enableLookups="true"
0134                acceptCount="10" debug="0" connectionTimeout="20000"
0135                proxyPort="80" useURIValidationHack="false" />
0136     -->
0137 
0138     <!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
0139     <!--
0140     <Connector className="org.apache.catalina.connector.http.HttpConnector"
0141                port="8083" minProcessors="5" maxProcessors="75"
0142                enableLookups="true" redirectPort="8443"
0143                acceptCount="10" debug="0" />
0144     -->
0145 
0146     <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
0147     <!--
0148     <Connector className="org.apache.catalina.connector.http10.HttpConnector"
0149                port="8084" minProcessors="5" maxProcessors="75"
0150                enableLookups="true" redirectPort="8443"
0151                acceptCount="10" debug="0" />
0152     -->
0153 
0154     <!-- An Engine represents the entry point (within Catalina) that processes
0155          every request.  The Engine implementation for Tomcat stand alone
0156          analyzes the HTTP headers included with the request, and passes them
0157          on to the appropriate Host (virtual host). -->
0158 
0159     <!-- Define the top level container in our container hierarchy -->
0160     <Engine name="Standalone" defaultHost="localhost" debug="0">
0161 
0162       <!-- The request dumper valve dumps useful debugging information about
0163            the request headers and cookies that were received, and the response
0164            headers and cookies that were sent, for all requests received by
0165            this instance of Tomcat.  If you care only about requests to a
0166            particular virtual host, or a particular application, nest this
0167            element inside the corresponding <Host> or <Context> entry instead.
0168 
0169            For a similar mechanism that is portable to all Servlet 2.3
0170            containers, check out the "RequestDumperFilter" Filter in the
0171            example application (the source for this filter may be found in
0172            "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
0173 
0174            Request dumping is disabled by default.  Uncomment the following
0175            element to enable it. -->
0176       <!--
0177       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
0178       -->
0179 
0180       <!-- Global logger unless overridden at lower levels -->
0181       <Logger className="org.apache.catalina.logger.FileLogger"
0182               prefix="catalina_log." suffix=".txt"
0183               timestamp="true"/>
0184 
0185       <!-- Because this Realm is here, an instance will be shared globally -->
0186 
0187       <!-- This Realm uses the UserDatabase configured in the global JNDI
0188            resources under the key "UserDatabase".  Any edits
0189            that are performed against this UserDatabase are immediately
0190            available for use by the Realm.  -->
0191       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
0192                  debug="0" resourceName="UserDatabase"/>
0193 
0194       <!-- Comment out the old realm but leave here for now in case we
0195            need to go back quickly -->
0196       <!--
0197       <Realm className="org.apache.catalina.realm.MemoryRealm" />
0198       -->
0199 
0200       <!-- Replace the above Realm with one of the following to get a Realm
0201            stored in a database and accessed via JDBC -->
0202 
0203       <!--
0204       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
0205              driverName="org.gjt.mm.mysql.Driver"
0206           connectionURL="jdbc:mysql://localhost/authority"
0207          connectionName="test" connectionPassword="test"
0208               userTable="users" userNameCol="user_name" userCredCol="user_pass"
0209           userRoleTable="user_roles" roleNameCol="role_name" />
0210       -->
0211 
0212       <!--
0213       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
0214              driverName="oracle.jdbc.driver.OracleDriver"
0215           connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
0216          connectionName="scott" connectionPassword="tiger"
0217               userTable="users" userNameCol="user_name" userCredCol="user_pass"
0218           userRoleTable="user_roles" roleNameCol="role_name" />
0219       -->
0220 
0221       <!--
0222       <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
0223              driverName="sun.jdbc.odbc.JdbcOdbcDriver"
0224           connectionURL="jdbc:odbc:CATALINA"
0225               userTable="users" userNameCol="user_name" userCredCol="user_pass"
0226           userRoleTable="user_roles" roleNameCol="role_name" />
0227       -->
0228 
0229       <!-- Define the default virtual host -->
0230       <Host name="localhost" debug="0" appBase="webapps" 
0231        unpackWARs="true" autoDeploy="true">
0232 
0233         <!-- Normally, users must authenticate themselves to each web app
0234              individually.  Uncomment the following entry if you would like
0235              a user to be authenticated the first time they encounter a
0236              resource protected by a security constraint, and then have that
0237              user identity maintained across *all* web applications contained
0238              in this virtual host. -->
0239         <!--
0240         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
0241                    debug="0"/>
0242         -->
0243 
0244         <!-- Access log processes all requests for this virtual host.  By
0245              default, log files are created in the "logs" directory relative to
0246              $CATALINA_HOME.  If you wish, you can specify a different
0247              directory with the "directory" attribute.  Specify either a relative
0248              (to $CATALINA_HOME) or absolute path to the desired directory.
0249         -->
0250         <!--
0251         <Valve className="org.apache.catalina.valves.AccessLogValve"
0252                  directory="logs"  prefix="localhost_access_log." suffix=".txt"
0253                  pattern="common" resolveHosts="false"/>
0254         -->
0255 
0256         <!-- Logger shared by all Contexts related to this virtual host.  By
0257              default (when using FileLogger), log files are created in the "logs"
0258              directory relative to $CATALINA_HOME.  If you wish, you can specify
0259              a different directory with the "directory" attribute.  Specify either a
0260              relative (to $CATALINA_HOME) or absolute path to the desired
0261              directory.-->
0262         <Logger className="org.apache.catalina.logger.FileLogger"
0263                  directory="logs"  prefix="localhost_log." suffix=".txt"
0264 	        timestamp="true"/>
0265 
0266         <!-- Define properties for each web application.  This is only needed
0267              if you want to set non-default properties, or have web application
0268              document roots in places other than the virtual host's appBase
0269              directory.  -->
0270 
0271         <!-- Tomcat Root Context -->
0272         <!--
0273           <Context path="" docBase="ROOT" debug="0"/>
0274         -->
0275 
0276         <!-- Tomcat Examples Context -->
0277         <Context path="/examples" docBase="examples" debug="0"
0278                  reloadable="true" crossContext="true">
0279           <Logger className="org.apache.catalina.logger.FileLogger"
0280                      prefix="localhost_examples_log." suffix=".txt"
0281         	  timestamp="true"/>
0282           <Ejb   name="ejb/EmplRecord" type="Entity"
0283                  home="com.wombat.empl.EmployeeRecordHome"
0284                remote="com.wombat.empl.EmployeeRecord"/>
0285 
0286           <!-- If you wanted the examples app to be able to edit the
0287                user database, you would uncomment the following entry.
0288                Of course, you would want to enable security on the
0289                application as well, so this is not done by default!
0290                The database object could be accessed like this:
0291 
0292                Context initCtx = new InitialContext();
0293                Context envCtx = (Context) initCtx.lookup("java:comp/env");
0294                UserDatabase database =
0295                     (UserDatabase) envCtx.lookup("userDatabase");
0296           -->
0297 <!--
0298           <ResourceLink name="userDatabase" global="UserDatabase"
0299                         type="org.apache.catalina.UserDatabase"/>
0300 -->
0301 
0302 
0303           <!-- PersistentManager: Uncomment the section below to test Persistent 
0304 		       Sessions.
0305                          
0306                saveOnRestart: If true, all active sessions will be saved
0307                  to the Store when Catalina is shutdown, regardless of
0308                  other settings. All Sessions found in the Store will be 
0309                  loaded on startup. Sessions past their expiration are
0310                  ignored in both cases.
0311                maxActiveSessions: If 0 or greater, having too many active 
0312                  sessions will result in some being swapped out. minIdleSwap
0313                  limits this. -1 means unlimited sessions are allowed.
0314                  0 means sessions will almost always be swapped out after
0315                  use - this will be noticeably slow for your users.
0316                minIdleSwap: Sessions must be idle for at least this long
0317                  (in seconds) before they will be swapped out due to 
0318                maxActiveSessions. This avoids thrashing when the site is 
0319                  highly active. -1 or 0 means there is no minimum - sessions
0320                  can be swapped out at any time.
0321                maxIdleSwap: Sessions will be swapped out if idle for this
0322                  long (in seconds). If minIdleSwap is higher, then it will
0323                  override this. This isn't exact: it is checked periodically.
0324                  -1 means sessions won't be swapped out for this reason,
0325                  although they may be swapped out for maxActiveSessions.
0326                  If set to >= 0, guarantees that all sessions found in the
0327                  Store will be loaded on startup.
0328                maxIdleBackup: Sessions will be backed up (saved to the Store,
0329                  but left in active memory) if idle for this long (in seconds), 
0330                  and all sessions found in the Store will be loaded on startup.
0331                  If set to -1 sessions will not be backed up, 0 means they
0332                  should be backed up shortly after being used.
0333 
0334                To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
0335                and minIdleBackup all to -1, saveOnRestart to false, then restart 
0336                Catalina.
0337           -->
0338 		  <!--
0339           <Manager className="org.apache.catalina.session.PersistentManager"
0340               debug="0"
0341               saveOnRestart="true"
0342               maxActiveSessions="-1"
0343               minIdleSwap="-1"
0344               maxIdleSwap="-1"
0345               maxIdleBackup="-1">
0346                 <Store className="org.apache.catalina.session.FileStore"/>
0347           </Manager>
0348 		  -->
0349           <Environment name="maxExemptions" type="java.lang.Integer"
0350                       value="15"/>
0351           <Parameter name="context.param.name" value="context.param.value"
0352                      override="false"/>
0353           <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
0354                     type="javax.sql.DataSource"/>
0355           <ResourceParams name="jdbc/EmployeeAppDb">
0356             <parameter><name>user</name><value>sa</value>< /parameter>
0357             <parameter><name>password</name><value></value></parameter>
0358             <parameter><name>driverClassName</name>
0359               <value>org.hsql.jdbcDriver</value></parameter>
0360             <parameter><name>driverName</name>
0361               <value>jdbc:HypersonicSQL:database</value></parameter>
0362           </ResourceParams>
0363           <Resource name="mail/Session" auth="Container"
0364                     type="javax.mail.Session"/>
0365           <ResourceParams name="mail/Session">
0366             <parameter>
0367               <name>mail.smtp.host</name>
0368               <value>localhost</value>
0369             </parameter>
0370           </ResourceParams>
0371           <ResourceLink name="linkToGlobalResource" 
0372                     global="simpleValue"
0373                     type="java.lang.Integer"/>
0374         </Context>
0375 
0376 <!-- @sannomiya add 2002.9.20  		start					
0377 
0378 <Context path="/javahello" docBase="javahello" debug="0" reloadable="true" >
0379 </Context>
0380  sannomiya add 2002.9.20  		end  					-->
0381 <!---->
0382 
0383       </Host>
0384 
0385     </Engine>
0386 
0387   </Service>
0388 
0389   <!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
0390        as its servlet container. Please read the README.txt file coming with
0391        the WebApp Module distribution on how to build it.
0392        (Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
0393 
0394        To configure the Apache side, you must ensure that you have the
0395        "ServerName" and "Port" directives defined in "httpd.conf".  Then,
0396        lines like these to the bottom of your "httpd.conf" file:
0397 
0398          LoadModule webapp_module libexec/mod_webapp.so
0399          WebAppConnection warpConnection warp localhost:8008
0400          WebAppDeploy examples warpConnection /examples/
0401 
0402        The next time you restart Apache (after restarting Tomcat, if needed)
0403        the connection will be established, and all applications you make
0404        visible via "WebAppDeploy" directives can be accessed through Apache.
0405   -->
0406 
0407   <!-- Define an Apache-Connector Service -->
0408 <!--
0409   <Service name="Tomcat-Apache">
0410 
0411     <Connector className="org.apache.catalina.connector.warp.WarpConnector"
0412      port="8008" minProcessors="5" maxProcessors="75"
0413      enableLookups="true" appBase="webapps"
0414      acceptCount="10" debug="0"/>
0415 
0416     <Engine className="org.apache.catalina.connector.warp.WarpEngine"
0417      name="Apache" debug="0">
0418 
0419       <Logger className="org.apache.catalina.logger.FileLogger"
0420               prefix="apache_log." suffix=".txt"
0421               timestamp="true"/>
0422 
0423       <Realm className="org.apache.catalina.realm.MemoryRealm" />
0424 
0425     </Engine>
0426 
0427   </Service>
0428 -->
0429 
0430 </Server>