cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
markt 2005/01/11 13:08:11 Modified:webapps/tomcat-docs manager-howto.xml Log: Fix bug 28867. Correct manager how to to show correct way to reference ROOT context. - Submitted by Stephane Bailliez Revision ChangesPath 1.21 +15 -22jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- manager-howto.xml 13 Jan 2003 23:25:45 - 1.20 +++ manager-howto.xml 11 Jan 2005 21:08:10 - 1.21 @@ -222,7 +222,7 @@ ul listrongpath/strong - The context path (including the leading slash) of the web application you are dealing with. To select the ROOT web -application, specify a zero-length string. strongNOTE/strong - +application, specify /. strongNOTE/strong - It is not possible to perform administrative commands on the Manager application itself./li listrongwar/strong - URL of a web application archive (WAR) file, @@ -312,9 +312,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context path was specified/em blockquote @@ -488,9 +487,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a / string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemContext path must match the directory or WAR file name:/em blockquote @@ -563,9 +561,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context exists for path /foo/em blockquote @@ -622,9 +619,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context exists for path /foo/em blockquote @@ -811,9 +807,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context exists for path /foo/em blockquote @@ -854,9 +849,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context exists for path /foo/em blockquote @@ -906,9 +900,8 @@ /blockquote/li liemInvalid context path was specified/em blockquote -pThe context path must start with a slash character, unless you are -referencing the ROOT web application -- in which case the context path -must be a zero-length string./p +pThe context path must start with a slash character. To reference the +ROOT web application use /./p /blockquote/li liemNo context exists for path /foo/em blockquote - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
glenn 2003/01/13 15:25:45 Modified:webapps/tomcat-docs manager-howto.xml Log: Trim down the length of the install source Revision ChangesPath 1.20 +3 -3 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- manager-howto.xml 13 Jan 2003 21:13:54 - 1.19 +++ manager-howto.xml 13 Jan 2003 23:25:45 - 1.20 @@ -416,15 +416,15 @@ pHere is an example of installing an application using a Context configuration .xml file. source -http://localhost:8080/manager/install?config=file:/path/to/context.xml +http://localhost:8080/manager/install?config=file:/path/context.xml /source /p pHere is an example of installing an application using a Context configuration .xml file and a web application .war file located on the server. -source -http://localhost:8080/manager/install?config=file:/path/to/context.xmlamp;war=jar:file:/path/to/bar.war!/ +source +http://localhost:8080/manager/install?config=file:/path/context.xmlamp;war=jar:file:/path/bar.war!/ /source /p -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
glenn 2002/08/29 20:46:27 Modified:webapps/tomcat-docs manager-howto.xml Log: Update the manager docs Revision ChangesPath 1.16 +49 -12jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- manager-howto.xml 6 Jun 2002 15:29:57 - 1.15 +++ manager-howto.xml 30 Aug 2002 03:46:27 - 1.16 @@ -48,15 +48,45 @@ directory./li /ul -pSince codeManager/code is itself a web application, it interacts with -you using standard HTTP requests and responses. However, it's user interface -is minimal, because it is intended to be accessed from scripts set up by the -system administrator. For this reason, commands are given as part of the +pThere are two ways to configure the Manager web application +codeContext/code: +ul +liInstall the codemanager.xml/code context configuration file +in the codeappBase/code for your codeHost/code./li +liConfigure the Manager codeContext/code within the +codeHost/code configuration in your Tomcat codeserver.xml/code +configuration. Here is an example: +pre +lt;Context path=/manager debug=0 privileged=true + docBase=/usr/local/kinetic/tomcat4/server/webapps/managergt; +lt;/Contextgt; +/pre +/li +/ul +/p + +pIf you have Tomcat configured to support multiple virtual hosts +(websites) you would need to configure a Manager for each./p + +pThere are three ways to use the codeManager/code web application. +ul +liAs an application with a user interface you use in your browser. +Here is an example URL where you can replace codelocalhost/code with +your website host name: codehttp://localhost/manager/html//code ./li +liA minimal version using HTTP requests only which is suitable for use +by scripts setup by system administrators. Commands are given as part of the request URI, and responses are in the form of simple text that can be easily -parsed and processed./p +parsed and processed. See a href=#Supported Manager Commands +Supported Manager Commands/a for more information./li +liA convenient set of task definitions for the emAnt/em +(version 1.4 or later) build tool. See +a href=#Executing Manager Commands With AntExecuting Manager Commands +With Ant/a for more information./li +/ul +/p pFuture versions of Tomcat 4 will include administrative functionality that -is presented in (at least) the following forms:/p +is presented in (at least) the following forms: ul liAs web services, so that Tomcat administration can be easily integrated into remote and/or non-Java mnagement environments./li @@ -64,12 +94,7 @@ web services processing layer) for easy Tomcat administration via a web browser./li /ul - -pIn addition to executing Manager commands directly via HTTP, Tomcat 4 -includes a convenient set of task definitions for the emAnt/em -(version 1.4 or later) build tool. See -a href=#Executing Manager Commands With AntExecuting Manager Commands -With Ant/a for more information./p +/p /section @@ -134,6 +159,18 @@ as long as they identify a valid user in the users database who possesses the role strongmanager/strong./p +pIn addition to the password restrictions the manager web application +could be restricted by the remote IP address or host by adding a +codeRemoteAddrValve/code or codeRemoteHostValve/code. Here is +an example of restricting access to the localhost by IP address: +pre +lt;Context path=/manager debug=0 privileged=true + docBase=/usr/local/kinetic/tomcat4/server/webapps/managergt; + lt;Valve className=org.apache.catalina.valves.RemoteAddrValve +allow=127.0.0.1/gt; +lt;/Contextgt; +/pre +/p /section -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
remm2002/06/06 08:29:57 Modified:webapps/tomcat-docs manager-howto.xml Log: - Make the example from the manager HOWTO valid XML (bug 9658). Revision ChangesPath 1.15 +6 -6 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- manager-howto.xml 8 Apr 2002 18:28:36 - 1.14 +++ manager-howto.xml 6 Jun 2002 15:29:57 - 1.15 @@ -734,18 +734,18 @@ trtdpre lt;project name=My Application default=compile basedir=.gt; - lt;-- Configure the directory into which the web application is built --gt; + lt;!-- Configure the directory into which the web application is built --gt; lt;property name=buildvalue=${basedir}/build/gt; - lt;-- Configure the context path for this application --gt; + lt;!-- Configure the context path for this application --gt; lt;property name=path value=/myapp/gt; - lt;-- Configure properties to access the Manager application --gt; + lt;!-- Configure properties to access the Manager application --gt; lt;property name=url value=http://localhost:8080/manager/gt; lt;property name=username value=myusername/gt; lt;property name=password value=mypassword/gt; - lt;-- Configure the custom Ant tasks for the Manager application --gt; + lt;!-- Configure the custom Ant tasks for the Manager application --gt; lt;taskdef name=deployclassname=org.apache.catalina.ant.DeployTask/gt; lt;taskdef name=install classname=org.apache.catalina.ant.InstallTask/gt; lt;taskdef name=list classname=org.apache.catalina.ant.ListTask/gt; @@ -757,9 +757,9 @@ lt;taskdef name=stop classname=org.apache.catalina.ant.StopTask/gt; lt;taskdef name=undeploy classname=org.apache.catalina.ant.UndeployTask/gt; - lt;-- Executable Targets --gt; + lt;!-- Executable Targets --gt; lt;target name=compile description=Compile web applicationgt; -... construct web application in ${build} subdirectory ... +lt;!-- ... construct web application in ${build} subdirectory ... --gt; lt;/targetgt; lt;target name=install description=Install web application -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc02/04/08 11:02:07 Modified:webapps/tomcat-docs manager-howto.xml Log: Update the Manager HOW-TO docs for the new /roles command. Revision ChangesPath 1.13 +55 -0 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- manager-howto.xml 14 Mar 2002 22:20:18 - 1.12 +++ manager-howto.xml 8 Apr 2002 18:02:07 - 1.13 @@ -39,6 +39,7 @@ liList the available global JNDI resources, for use in deployment tools that are preparing codelt;ResourceLinkgt;/code elements nested in a codelt;Contextgt;/code deployment description./li +liList the available security roles defined in the user database./li liRemove an installed web application./li liStart a stopped application (thus making it available again)./li liStop an existing application (so that it becomes unavailable), but @@ -487,6 +488,60 @@ /subsection + + +subsection name=List Available Security Roles + +source +http://localhost:8080/manager/roles +/source + +pList the security role names (and corresponding descriptions) that are +available in the codeorg.apache.catalina.UserDatabase/code resource that +is linked to the codeusers/code resource reference in the web.xml file +for the Manager web application. This would typically be used, for example, +by a deployment tool that wanted to create +codelt;security-role-refgt;/code elements to map security role names +used in a web application to the role names actually defined within the +container./p + +pBy default, the codeusers/code resource reference is pointed at the +global codeUserDatabase/code resource. If you choose to utilize a +different user database per virtual host, you should modify the +codelt;ResourceLinkgt;/code element in the default +codemanager.xml/code context configuration file to point at the global +user database resource for this virtual host./p + +pWhen this command is executed, the first line of the response will be:/p +pre + OK - Listed security roles +/pre +pfollowed by one line for each security role. Each line is composed of +fields delimited by colon characters (:) as follows:/p +ul +liemSecurity Role Name/em - A security role name that is known to Tomcat +in the user database./li +liemDescription/em - Description of this security role (useful in +creating user interfaces for selecting roles./li +/ul + +pIf an error occurs, the response will start with codeFAIL/code and +include an error message. Possible causes for problems include:/p +ul +liemCannot resolve user database reference/em - A JNDI error prevented +the successful lookup of the codeorg.apache.catalina.UserDatabase/code +resource. Check the Tomcat log files for a stack trace associated with +this error./li +liemNo user database is available/em - You have not configured a resource +reference for the codeusers/code resource that points at an +appropriate user database instance. Check your codemanager.xml/code +file and ensure that you have created an appropriate +codelt;ResourceLinkgt;/code or +codelt;ResourceParamsgt;/code element for this resource./li +/ul + +/subsection + subsection name=Session Statistics -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
amyroh 02/03/14 14:20:18 Modified:webapps/tomcat-docs manager-howto.xml Log: Simple spelling patch submitted by Ian Darwin [EMAIL PROTECTED] Revision ChangesPath 1.12 +1 -1 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- manager-howto.xml 12 Mar 2002 21:14:16 - 1.11 +++ manager-howto.xml 14 Mar 2002 22:20:18 - 1.12 @@ -113,7 +113,7 @@ which defines the username and password used by this individual to log on, and the role names he or she is associated with. You can add the strongmanager/strong role to the comma-delimited -coderoles/code attriute for one or more existing users, and/or +coderoles/code attribute for one or more existing users, and/or create new users with that assigned role./li liemJDBCRealm/em - Your user and role information is stored in a database accessed via JDBC. Add the strongmanager/strong role -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc02/03/12 13:14:16 Modified:catalina/src/share/org/apache/catalina/servlets LocalStrings.properties ManagerServlet.java webapps/tomcat-docs manager-howto.xml Added: catalina/src/share/org/apache/catalina/ant ResourcesTask.java Log: Add a new /resources command that will enumerate the available global JNDI resources (either all of them, or all of them for a specific type like javax.sql.DataSource). This is useful to tools that want to package up webapps and create the Context configuration element, with embedded ResourceLink elements that link resource references in the web.xml to the corresponding actual resources. Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/ResourcesTask.java Index: ResourcesTask.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/ResourcesTask.java,v 1.1 2002/03/12 21:14:15 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2002/03/12 21:14:15 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.catalina.ant; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; /** * Ant task that implements the code/list/code command, supported by the * Tomcat manager application. * * @author Craig R. McClanahan * @version $Revision: 1.1 $ $Date: 2002/03/12 21:14:15 $ * @since 4.1 */ public class ResourcesTask extends AbstractCatalinaTask { // - Properties /** * The fully qualified class name of the resource type being requested * (if any). */ protected String type = null; public String getType() { return (this.type); } public void setType(String type) { this.type = type; } // - Public Methods /** * Execute the requested operation. * * @exception BuildException if an error occurs */ public void execute()
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc02/02/26 21:40:57 Modified:catalina/src/share/org/apache/catalina/servlets LocalStrings.properties ManagerServlet.java webapps/admin banner.jsp webapps/admin/WEB-INF/classes/org/apache/webapp/admin ApplicationResources_en.properties webapps/tomcat-docs manager-howto.xml Log: Since a /reload command has no effect on an application that is loaded directly from a WAR file, report it as an error instead of pretending to perform the reload. Revision ChangesPath 1.12 +1 -0 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/LocalStrings.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- LocalStrings.properties 12 Feb 2002 22:14:02 - 1.11 +++ LocalStrings.properties 27 Feb 2002 05:40:57 - 1.12 @@ -25,6 +25,7 @@ managerServlet.noDirectory=FAIL - Non-directory document base for path {0} managerServlet.noDocBase=FAIL - Cannot remove document base for path {0} managerServlet.noPath=FAIL - No context path was specified +managerServlet.noReload=FAIL - Reload not supported on WAR deployed at path {0} managerServlet.noRename=FAIL - Cannot deploy uploaded WAR for path {0} managerServlet.noRole=FAIL - User does not possess role {0} managerServlet.noWrapper=Container has not called setWrapper() for this servlet 1.13 +15 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java Index: ManagerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ManagerServlet.java 12 Feb 2002 22:14:02 - 1.12 +++ ManagerServlet.java 27 Feb 2002 05:40:57 - 1.13 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v 1.12 2002/02/12 22:14:02 craigmcc Exp $ - * $Revision: 1.12 $ - * $Date: 2002/02/12 22:14:02 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v 1.13 2002/02/27 05:40:57 craigmcc Exp $ + * $Revision: 1.13 $ + * $Date: 2002/02/27 05:40:57 $ * * * @@ -75,6 +75,7 @@ import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import javax.naming.directory.DirContext; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.UnavailableException; @@ -90,6 +91,8 @@ import org.apache.catalina.Session; import org.apache.catalina.Wrapper; import org.apache.catalina.util.StringManager; +import org.apache.naming.resources.ProxyDirContext; +import org.apache.naming.resources.WARDirContext; /** @@ -179,7 +182,7 @@ * /ul * * @author Craig R. McClanahan - * @version $Revision: 1.12 $ $Date: 2002/02/12 22:14:02 $ + * @version $Revision: 1.13 $ $Date: 2002/02/27 05:40:57 $ */ public class ManagerServlet @@ -741,6 +744,14 @@ if (context == null) { writer.println(sm.getString(managerServlet.noContext, displayPath)); return; +} +DirContext resources = context.getResources(); +if (resources instanceof ProxyDirContext) { +resources = ((ProxyDirContext) resources).getDirContext(); +} +if (resources instanceof WARDirContext) { +writer.println(sm.getString(managerServlet.noReload, displayPath)); +return; } context.reload(); writer.println(sm.getString(managerServlet.reloaded, displayPath)); 1.3 +3 -7 jakarta-tomcat-4.0/webapps/admin/banner.jsp Index: banner.jsp === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/banner.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- banner.jsp13 Nov 2001 01:00:03 - 1.2 +++ banner.jsp27 Feb 2002 05:40:57 - 1.3 @@ -15,16 +15,14 @@ body bgcolor=white -center - -h2bean:message key=index.success//h2 +h2 align=centerbean:message key=index.success//h2 p -h2 +h3 align=center bean:message key=index.logout/ html:link page=/logOut.do target=_top
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc02/02/12 14:14:02 Modified:catalina/src/share/org/apache/catalina/ant AbstractCatalinaTask.java InstallTask.java ListTask.java ReloadTask.java StartTask.java StopTask.java catalina/src/share/org/apache/catalina/servlets LocalStrings.properties ManagerServlet.java webapps/tomcat-docs manager-howto.xml Added: catalina/src/share/org/apache/catalina/ant DeployTask.java UndeployTask.java Log: Enhance the Manager webapp to support two new facilities: * Deploy a new application (optionally to a Tomcat instance running on a different server) by uploading the WAR file to it. * Undeploy an existing application and remove its document base directory from webapps. * Support these commands with new custom Ant tasks, typically named deploy and undeploy. The first of these commands is useful only within tools, becasue it requires an HTTP put. However, it is supported by an Ant task for use in build scripts. If you want to do application development in place, inside the context root directory of a running webapp, you will probably want to use the install command rather than the deploy command. Revision ChangesPath 1.2 +81 -15 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java Index: AbstractCatalinaTask.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractCatalinaTask.java 11 Jan 2002 00:37:30 - 1.1 +++ AbstractCatalinaTask.java 12 Feb 2002 22:14:01 - 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java,v 1.1 2002/01/11 00:37:30 craigmcc Exp $ - * $Revision: 1.1 $ - * $Date: 2002/01/11 00:37:30 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java,v 1.2 2002/02/12 22:14:01 craigmcc Exp $ + * $Revision: 1.2 $ + * $Date: 2002/02/12 22:14:01 $ * * * @@ -63,8 +63,10 @@ package org.apache.catalina.ant; +import java.io.BufferedOutputStream; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import org.apache.catalina.util.Base64; @@ -79,7 +81,8 @@ * undeploying applications. These tasks require Ant 1.4 or later. * * @author Craig R. McClanahan - * @version $Revision: 1.1 $ $Date: 2002/01/11 00:37:30 $ + * @version $Revision: 1.2 $ $Date: 2002/02/12 22:14:01 $ + * @since 4.1 */ public abstract class AbstractCatalinaTask extends Task { @@ -165,30 +168,84 @@ */ public void execute(String command) throws BuildException { +execute(command, null, null, -1); + +} + + +/** + * Execute the specified command, based on the configured properties. + * The input stream will be closed upon completion of this task, whether + * it was executed successfully or not. + * + * @param command Command to be executed + * @param istream InputStream to include in an HTTP PUT, if any + * @param contentType Content type to specify for the input, if any + * @param contentLength Content length to specify for the input, if any + * + * @exception BuildException if an error occurs + */ +public void execute(String command, InputStream istream, +String contentType, int contentLength) +throws BuildException { + URLConnection conn = null; InputStreamReader reader = null; try { // Create a connection for this command conn = (new URL(url + command)).openConnection(); +HttpURLConnection hconn = (HttpURLConnection) conn; // Set up standard connection characteristics -conn.setAllowUserInteraction(false); -conn.setDoInput(true); -conn.setDoOutput(false); -conn.setUseCaches(false); -conn.setRequestProperty(User-Agent, -Catalina-Ant-Task/1.0); +hconn.setAllowUserInteraction(false); +hconn.setDoInput(true); +hconn.setUseCaches(false); +if (istream != null) { +hconn.setDoOutput(true); +hconn.setRequestMethod(PUT); +if (contentType != null) { +
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc02/01/10 16:37:31 Modified:catalina build.xml webapps/tomcat-docs manager-howto.xml Added: catalina/src/share/org/apache/catalina/ant AbstractCatalinaTask.java InstallTask.java ListTask.java ReloadTask.java RemoveTask.java StartTask.java StopTask.java Log: Many people find the Manager webapp useful in installing and removing applications from a running instance of Tomcat 4. This checkin adds a set of custom Ant tasks that correspond to each of the commands that Manager supports, so you can use them in build.xml scripts for your web applications directly. Documentation and an example build.xml script are in the updated manager-howto.xml file. Revision ChangesPath 1.95 +9 -0 jakarta-tomcat-4.0/catalina/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- build.xml 5 Jan 2002 20:24:30 - 1.94 +++ build.xml 11 Jan 2002 00:37:30 - 1.95 @@ -865,6 +865,7 @@ !-- Catalina Main JAR File -- jar jarfile=${catalina.deploy}/server/lib/catalina.jar fileset dir=${catalina.build}/server/classes +exclude name=org/apache/catalina/ant/** / exclude name=org/apache/naming/** / exclude name=**/connector/warp/** / exclude name=org/apache/catalina/startup/Bootstrap.class / @@ -877,6 +878,14 @@ exclude name=org/apache/catalina/startup/SecurityClassLoad.class / exclude name=org/apache/catalina/servlets/** / exclude name=org/apache/catalina/util/ssi/** / + /fileset +/jar + +!-- Catalina Ant Tasks JAR File -- +jar jarfile=${catalina.deploy}/server/lib/catalina-ant.jar + fileset dir=${catalina.build}/server/classes +include name=org/apache/catalina/ant/** / +include name=org/apache/catalina/util/Base64.class / /fileset /jar 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java Index: AbstractCatalinaTask.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ant/AbstractCatalinaTask.java,v 1.1 2002/01/11 00:37:30 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2002/01/11 00:37:30 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
remm01/11/16 11:04:06 Modified:webapps/tomcat-docs manager-howto.xml Log: - Small corrections to the manager-howto. Patch submitted by Erik Stenflo. Revision ChangesPath 1.6 +2 -2 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- manager-howto.xml 2001/11/12 21:03:49 1.5 +++ manager-howto.xml 2001/11/16 19:04:06 1.6 @@ -93,7 +93,7 @@ codelt;usergt;/code for each individual user, which might look something like this: source -lt;user name=craigmcc password=secret roles=standard,managergt; +lt;user name=craigmcc password=secret roles=standard,manager /gt; /source which defines the username and password used by this individual to log on, and the role names he or she is associated with. You can @@ -113,7 +113,7 @@ /ul pThe first time you attempt to issue one of the Manager commands -described in the next section, you will be challenged to logn on, using +described in the next section, you will be challenged to log on using BASIC authentication. The username and password you enter do not matter, as long as they identify a valid user in the users database who possesses the role strongmanager/strong./p -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
remm01/11/16 11:09:09 Modified:webapps/tomcat-docs Tag: tomcat_40_branch manager-howto.xml Log: - Fix CRLF ? - Small corrections to the manager-howto. Patch submitted by Erik Stenflo. Revision ChangesPath No revision No revision 1.4.2.1 +466 -466 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -r1.4 -r1.4.2.1 --- manager-howto.xml 2001/09/14 20:08:01 1.4 +++ manager-howto.xml 2001/11/16 19:09:09 1.4.2.1 @@ -1,466 +1,466 @@ -?xml version=1.0? -!DOCTYPE document [ - !ENTITY project SYSTEM project.xml -] -document - -project; - -properties -author email=[EMAIL PROTECTED]Craig R. McClanahan/author -titleManager App HOW-TO/title -/properties - -body - - -section name=Introduction - -pIn many production environments, it is very useful to have the capability -to deploy a new web application, or undeploy an existing one, without having -to shut down and restart the entire container. In addition, you can request -an existing application to reload itself, even if you have not declared it -to be codereloadable/code in the Tomcat 4 server -configuration file./p - -pTo support these capabilities, Tomcat 4 includes a web application -(installed by default on context path code/manager/code) that supports -the following functions:/p -ul -liDeploy a new web application, on a specified context path, from a -specified directory or WAR file pathname./li -liList the currently deployed web applications, as well as the -sessions that are currently active for those web apps./li -liCause an existing application to be reloaded./li -liUndeploy an existing web application./li -liStop an existing application (so that it becomes unavailable), but -do not undeploy it./li -liStart a stopped application (thus making it available again)./li -/ul - -pSince codeManager/code is itself a web application, it interacts with -you using standard HTTP requests and responses. However, it's user interface -is minimal, because it is intended to be accessed from scripts set up by the -system administrator. For this reason, commands are given as part of the -request URI, and responses are in the form of simple text that can be easily -parsed and processed./p - -pFuture versions of Tomcat 4 will include administrative functionality that -is presented in (at least) the following forms:/p -ul -liAs web services, so that Tomcat administration can be easily integrated -into remote and/or non-Java mnagement environments./li -liAs a web application with a nice user interface (built on top of the -web services processing layer) for easy Tomcat administration via a -web browser./li -/ul - -/section - -section name=Configuring Manager Application Access - -blockquoteem -pThe description below uses the variable name $CATALINA_HOME -to refer to the directory into which you have installed Tomcat 4, -and is the base directory against which most relative paths are -resolved. However, if you have configured Tomcat 4 for multiple -instances by setting a CATALINA_BASE directory, you should use -$CATALINA_BASE instead of $CATALINA_HOME for each of these -references./p -/em/blockquote - -pIt would be quite unsafe to ship Tomcat with default settings that allowed -anyone on the Internet to execute the Manager application on your server. -Therefore, the Manager application is shipped with the requirement that anyone -who attempts to use it must authenticate themselves, using a username and -password that have the role strongmanager/strong associated with them. -Further, there is no username in the default users file -(conf$CATALINA_HOME/conf/tomcat-users.xml/conf) that is assigned this -role. Therefore, access to the Manager application is completely disabled -by default./p - -pTo enable access to the Manager web application, you must either create -a new username/password combination and associate the role name -strongmanager/strong with it, or add the strongmanager/strong role -to some existing username/password combination. Exactly where this is done -depends on which codeRealm/code implementation you are using:/p -ul -liemMemoryRealm/em - If you have not customized your -code$CATALINA_HOME/conf/server.xml/code to select a different one, -Tomcat 4 defaults to an XML-format file stored at -code$CATALINA_HOME/conf/tomcat-users.xml/code, which
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml
craigmcc01/09/14 13:08:01 Modified:webapps/tomcat-docs manager-howto.xml Log: Correct the syntax of jar: URLs that reference a local or remote web application archive (WAR) file. Submitted by: Jeff Turner [EMAIL PROTECTED] Revision ChangesPath 1.4 +5 -2 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- manager-howto.xml 2001/09/13 15:49:15 1.3 +++ manager-howto.xml 2001/09/14 20:08:01 1.4 @@ -179,13 +179,16 @@ source http://localhost:8080/manager/install?path=/fooamp;war=file:/path/to/foo -http://localhost:8080/manager/install?path=/baramp;war=file:/path/to/bar.war +http://localhost:8080/manager/install?path=/baramp;war=jar:file:/path/to/bar.war!/ /source pInstall and start a new web application, attached to the specified context path (which must not be in use by any other web application). The codewar/code parameter specifies a URL (including the codefile:/code -scheme) for either a directory or a web application archive (WAR) file./p +scheme) for either a directory or a web application archive (WAR) file. +The supported syntax for a URL referring to a WAR file is described on the +Javadocs page for the codejava.net.JarURLConnection/code class. Use +only URLs that refer to the entire WAR file./p pIf installation and startup is successful, you will receive a response like this:/p
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs manager-howto.xml index.xml project.xml
craigmcc01/08/16 16:21:25 Modified:webapps/tomcat-docs index.xml project.xml Added: webapps/tomcat-docs manager-howto.xml Log: Add a HOW-TO doc for the Manager web application (motivated by Christopher's SSL HOW-TO and a couple of questions on TOMCAT-USER today). Revision ChangesPath 1.7 +5 -1 jakarta-tomcat-4.0/webapps/tomcat-docs/index.xml Index: index.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/index.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- index.xml 2001/08/16 20:21:54 1.6 +++ index.xml 2001/08/16 23:21:25 1.7 @@ -62,7 +62,11 @@ - Reference manual that documents all available elements and attributes that may be placed into a Tomcat 4 codeconf/server.xml/code file. /li -lia href=ssl-howto.htmlstrongSSL HOW-TO/strong/a - Installing and +lia href=manager-howto.htmlstrongManager App HOW-TO/strong/a - +Operating the codeManager/code web app to deploy, undeploy, and +redeploy applications while Tomcat is running./li +lia href=ssl-howto.htmlstrongSSL Configuration HOW-TO/strong/a - +Installing and configuring SSL support so that your Tomcat will serve requests using the codehttps/code protocol./li /ul 1.7 +2 -1 jakarta-tomcat-4.0/webapps/tomcat-docs/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- project.xml 2001/08/16 20:21:54 1.6 +++ project.xml 2001/08/16 23:21:25 1.7 @@ -24,7 +24,8 @@ menu name=Administrators item name=Config. Reference href=config/index.html/ -item name=SSL HOW-TOhref=ssl-howto.html/ +item name=Manager App HOW-TOhref=manager-howto.html/ +item name=SSL Config HOW-TO href=ssl-howto.html/ /menu menu name=Application Developers 1.1 jakarta-tomcat-4.0/webapps/tomcat-docs/manager-howto.xml Index: manager-howto.xml === ?xml version=1.0? !DOCTYPE document [ !ENTITY project SYSTEM project.xml ] document project; properties author email=[EMAIL PROTECTED]Craig R. McClanahan/author titleManager App HOW-TO/title /properties body section name=Introduction pIn many production environments, it is very useful to have the capability to deploy a new web application, or undeploy an existing one, without having to shut down and restart the entire container. In addition, you can request an existing application to reload itself, even if you have not declared it to be codereloadable/code in the Tomcat 4 server configuration file./p pTo support these capabilities, Tomcat 4 includes a web application (installed by default on context path code/manager/code) that supports the following functions:/p ul liDeploy a new web application, on a specified context path, from a specified directory or WAR file pathname./li liList the currently deployed web applications, as well as the sessions that are currently active for those web apps./li liCause an existing application to be reloaded./li liUndeploy an existing web application./li liStop an existing application (so that it becomes unavailable), but do not undeploy it./li liStart a stopped application (thus making it available again)./li /ul pSince codeManager/code is itself a web application, it interacts with you using standard HTTP requests and responses. However, it's user interface is minimal, because it is intended to be accessed from scripts set up by the system administrator. For this reason, commands are given as part of the request URI, and responses are in the form of simple text that can be easily parsed and processed./p pFuture versions of Tomcat 4 will include administrative functionality that is presented in (at least) the following forms:/p ul liAs web services, so that Tomcat administration can be easily integrated into remote and/or non-Java mnagement environments./li liAs a web application with a nice user interface (built on top of the web services processing layer) for easy Tomcat administration via a web browser./li /ul /section section name=Configuring Manager Application Access pIt would be quite unsafe to ship Tomcat with default settings that allowed anyone on the Internet to execute the Manager application on your server. Therefore, the Manager application is shipped with the requirement