How to Use the autoDeploy Attribute in Apache Tomcat (Linux)

  • google plus

In Brief...

When we copy a WAR file to the application base directory of Apache Tomcat we usually expect the web application to be deployed. In other words, we expect the web site to be immediately available on the World Wide Web. However, this doesn't always have to be the case. The autoDeply attribute on the Host element determines if the web application will be available for access on the internet.

Take our Apache Tomcat Administration for Windows Training course for free.

See the Course Outline and Register

Instructions

To learn how to use the autoDeploy attribute in Apache Tomcat, follow these 2 steps:

  1. Open a text editor session on CATALINA_BASE/conf/server.xml,e.g., /var/lib/tomcat7/conf/server.xml.
  2. Locate the Host element using your editor's search facility. The entry will look similar to the following:
    <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true">
    	
    Note that the autoDeply attribute is set to true. As you would imagine, this setting indicates that a WAR file or a context file that is copied to Tomcat will be made available for processing. This is to say, the web application will be deployed. If you set the value to false and then restart the Tomcat server, the web applications will not be deployed. In order to deploy the web applications so that the outside world can use them you will have to use either the Tomcat manager web application or JMX beans.

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, XML, Windows, Java, Adobe, HTML5, JavaScript, Angular, and much more. Check out our complete course catalog.

Categories

Courses

Author: Stephen Withrow

Stephen has over 30 years' experience in training, development, and consulting in a variety of technology areas including Java, C, C++, XML, JavaScript, AJAX, Tomcat, JBoss, Oracle, and DB2. His background includes design and implementation of business solutions on client/server, Web, and enterprise platforms. Stephen is a published writer in both technical and non-technical endeavors. Stephen received an undergraduate degree in Computer Science and Physics from Florida State University.

Discuss