How to Undeploy Web Applications Using the Apache Tomcat Manager (Windows)

See Apache: Tips and Tricks for similar articles.
Looking to improve your Apache Web Server skills? Check out Webucator’s Apache Web Server classes.

One important function of the Apache Tomcat manager web application is to undeploy web applications. In other words, the website will be removed from Tomcat and therefore no longer be available on the World Wide Web.

To learn how to undeploy web applications using the Apache Tomcat manager, follow these eight steps:

  1. Start the Tomcat server.
  2. You'll need to create a WAR file so that you'll have a sample website to undeploy. For instructions for creating and deploying a WAR file, click here. Follow all of the steps before proceeding to the next step here.
  3. You'll need to create credentials to access the Tomcat manager. For instructions for setting up a user name and password, click here. You will need to restart the Tomcat server after completing the steps in that topic.
  4. In the address area of your browser, type http://localhost:8080/manager/html and submit that address to the browser.
  5. You will be challenged for credentials. Provide the user name and password you specified in tomcat-users.xml (make sure to provide the correct spelling and case): Manager credentials Click OK.
  6. The manager web page contains a list of the deployed web applications: Manager list deployed apps for undeploy Note that each application, including DemoWebsite has an associated set of buttons that allows you to start, stop, reload, and undeploy the web application. We will focus our attention now on the undeploy operation. Undeploy will delete the WAR file and unpacked folder under the "webapps" folder (note: if you have deployed the web application as a context file, then the context file will be deleted from CATALINA_BASE/conf/Catalina/host_name, e.g., c:/Tomcat8/conf/Catalina/localhost). **IMPORTANT: Before you undeploy your website, make sure you have a backup of the WAR file (or context file) in case you need to deploy the web application in the future.
  7. Click the undeploy button associated with DemoWebsite. The manager will respond indicating the web application has been undeployed: Manager undeployed message
  8. The website has now been removed from Tomcat. If you attempt to access the website through your browser, Tomcat will return a 404 HTTP status: Manager DemoWebsite HTTP 404

Related Articles

  1. How to Start and Stop Apache Tomcat from the Command Line (Windows)
  2. How to Deploy a WAR File to Apache Tomcat (Windows)
  3. How to Start and Stop Apache Tomcat from the Command Line (Linux)
  4. How to Deploy a WAR File to Apache Tomcat (Linux)
  5. How to Run a JSP Program in Apache Tomcat (Windows)
  6. How to Check the Status of the Apache Tomcat Server (Windows)
  7. How to Deploy a Web Application Using the Apache Tomcat Manager (Windows)
  8. How to Check the Status of the Apache Tomcat Server (Linux)
  9. How to Set Default Context Path in Apache Tomcat (Windows)
  10. How to Use the autoDeploy Attribute in Apache Tomcat (Windows)
  11. How to Deploy a Web Application Using the Apache Tomcat Manager (Linux)
  12. How to List Deployed Applications Using the Apache Tomcat Manager (Windows)
  13. How to Run Multiple Instances of Apache Tomcat on One Server (Windows)
  14. How to Run a JSP Program in Apache Tomcat (Linux)
  15. How to Establish a JDBC Connection in Apache Tomcat (Windows)
  16. How to Verify Apache Tomcat Server Operation (Windows)
  17. How to Cluster in Apache Tomcat (Linux)
  18. How to Undeploy Web Applications Using the Apache Tomcat Manager (Windows) (this article)
  19. How to Set Default Context Path in Apache Tomcat (Linux)
  20. How to Use the Java Logging API in Apache Tomcat (Windows)
  21. How to Cluster in Apache Tomcat (Windows)
  22. How to Use the Java Logging API in Apache Tomcat (Linux)
  23. How to Use the autoDeploy Attribute in Apache Tomcat (Linux)
  24. How to Configure Apache Tomcat to Use MBeans (Windows)
  25. How to List Deployed Applications Using the Apache Tomcat Manager (Linux)
  26. How to Install and Configure Apache Tomcat (Windows)
  27. How to Configure Apache Tomcat to Use MBeans (Linux)