craigmcc 00/12/13 18:56:14
Modified: catalina/src/conf server.xml
catalina/src/share/org/apache/catalina Service.java
catalina/src/share/org/apache/catalina/core
LocalStrings.properties StandardService.java
Log:
Fix a bug that prevented starting multiple <Service> entries at
Tomcat startup time.
Modify the default "server.xml" file to include configuration of the
Apache Connector. So far, this connector has only been tested VERY
lightly, and only on Unix systems. It is likely to have significant
bugs -- please help us shake them out.
Revision Changes Path
1.15 +53 -2 jakarta-tomcat-4.0/catalina/src/conf/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/server.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- server.xml 2000/12/07 07:27:59 1.14
+++ server.xml 2000/12/14 02:56:13 1.15
@@ -23,7 +23,7 @@
-->
<!-- Define the Tomcat Stand-Alone Service -->
- <Service>
+ <Service name="Tomcat-Standalone">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
@@ -70,7 +70,7 @@
on to the appropriate Host (virtual host). -->
<!-- Define the top level container in our container hierarchy -->
- <Engine name="engine" defaultHost="localhost" debug="0">
+ <Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
@@ -171,5 +171,56 @@
</Engine>
</Service>
+
+ <!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
+ as its servlet container. This is built by following these steps:
+
+ - cd {TOMCAT-SRC-HOME}/connectors
+ - make
+ - (Edit "Makedefs" as needed for your installation)
+ - make
+ - su root
+ - cp connectors/apache-1.3/mod_webapp.so {APACHE_HOME}/libexec
+ - exit
+
+ To configure the Apache side, you must ensure that you have a
+ "ServerName" directive defined in "httpd.conf". Then, lines like
+ these to the bottom of your "httpd.conf" file:
+
+ LoadModule webapp_module libexec/mod_webapp.so
+ WebAppConnection warpConnection warp localhost:8008
+ WebAppMount examples warpConnection /examples/
+
+ Finally, modify the "defaultHost" attribute in the "Engine" directive
+ below to match the "ServerName" setting defined in "https.conf". The
+ next time you restart Apache (after restarting Tomcat, if needed)
+ the connection will be established, and all applications you make
+ visible via "WebAppMount" directives can be accessed through Apache.
+ -->
+
+
+ <!-- Define an Apache-Connector Service -->
+ <Service name="Tomcat-Apache">
+
+ <Connector className="org.apache.catalina.connector.warp.WarpConnector"
+ port="8008" minProcessors="5" maxProcessors="75"
+ acceptCount="10" debug="0"/>
+
+ <!-- Replace "localhost" with what your Apache "ServerName" is set to -->
+ <Engine className="org.apache.catalina.connector.warp.WarpEngine"
+ name="Apache" defaultHost="localhost" debug="0" appBase="webapps">
+
+ <!-- Global logger unless overridden at lower levels -->
+ <Logger className="org.apache.catalina.logger.FileLogger"
+ prefix="apache_log." suffix=".txt"
+ timestamp="true"/>
+
+ <!-- Because this Realm is here, an instance will be shared globally -->
+ <Realm className="org.apache.catalina.realm.MemoryRealm" />
+
+ </Engine>
+
+ </Service>
+
</Server>
1.2 +17 -3
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java
Index: Service.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Service.java 2000/09/30 19:15:43 1.1
+++ Service.java 2000/12/14 02:56:13 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java,v 1.1
2000/09/30 19:15:43 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2000/09/30 19:15:43 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java,v 1.2
2000/12/14 02:56:13 craigmcc Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/12/14 02:56:13 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* and classes on the system class path.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.1 $ $Date: 2000/09/30 19:15:43 $
+ * @version $Revision: 1.2 $ $Date: 2000/12/14 02:56:13 $
*/
public interface Service {
@@ -107,6 +107,20 @@
* <code><description>/<version></code>.
*/
public String getInfo();
+
+
+ /**
+ * Return the name of this Service.
+ */
+ public String getName();
+
+
+ /**
+ * Set the name of this Service.
+ *
+ * @param name The new service name
+ */
+ public void setName(String name);
// --------------------------------------------------------- Public Methods
1.21 +2 -0
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- LocalStrings.properties 2000/12/01 02:11:22 1.20
+++ LocalStrings.properties 2000/12/14 02:56:14 1.21
@@ -98,7 +98,9 @@
standardServer.start.connectors=At least one connector is not associated with any
container
standardServer.start.started=This server has already been started
standardServer.stop.notStarted=This server has not yet been started
+standardService.start.name=Starting service {0}
standardService.start.started=This service has already been started
+standardService.stop.name=Stopping service {0}
standardService.stop.notStarted=This service has not yet been started
standardWrapper.allocate=Error allocating a servlet instance
standardWrapper.allocateException=Allocate exception for servlet {0}
1.2 +36 -3
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java
Index: StandardService.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StandardService.java 2000/09/30 19:15:45 1.1
+++ StandardService.java 2000/12/14 02:56:14 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java,v
1.1 2000/09/30 19:15:45 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2000/09/30 19:15:45 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java,v
1.2 2000/12/14 02:56:14 craigmcc Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/12/14 02:56:14 $
*
* ====================================================================
*
@@ -83,7 +83,7 @@
* not required.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.1 $ $Date: 2000/09/30 19:15:45 $
+ * @version $Revision: 1.2 $ $Date: 2000/12/14 02:56:14 $
*/
public final class StandardService
@@ -113,6 +113,12 @@
/**
+ * The name of this service.
+ */
+ private String name = this.toString();
+
+
+ /**
* The lifecycle event support for this component.
*/
private LifecycleSupport lifecycle = new LifecycleSupport(this);
@@ -191,6 +197,28 @@
}
+ /**
+ * Return the name of this Service.
+ */
+ public String getName() {
+
+ return (this.name);
+
+ }
+
+
+ /**
+ * Set the name of this Service.
+ *
+ * @param name The new service name
+ */
+ public void setName(String name) {
+
+ this.name = name;
+
+ }
+
+
// --------------------------------------------------------- Public Methods
@@ -314,6 +342,8 @@
throw new LifecycleException
(sm.getString("standardService.start.started"));
+ System.out.println
+ (sm.getString("standardService.start.name", this.name));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
@@ -351,6 +381,9 @@
throw new LifecycleException
(sm.getString("standardService.stop.notStarted"));
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
+
+ System.out.println
+ (sm.getString("standardService.stop.name", this.name));
started = false;
// Stop our defined Connectors first