To deploy a web application to Apache Tomcat you can copy a WAR file to the application base directory, e.g.,
/var/lib/tomcat7/webapps. This operation of course
presupposes we know the application base directory. We could consult
server.xml and look up the
Host element to determine the directory name. A
more straightforward approach is to use the Tomcat manager web application.
To learn how to deploy a web application using the Apache Tomcat manager web application in Linux, follow these 12 steps:
/var/lib/tomcat7/conf/tomcat-users.xmlto add credentials to access the Tomcat manager web application.
<role rolename="manager-gui"/> <user username="your name" password="your password" roles="manager-gui"/> </tomcat-users>
DemoWebsite.war) and the unpacked folder (
http://localhost:8080/manager/htmland submit that address to the browser.
tomcat-users.xml(make sure to provide the correct spelling and case):
/DemoWebsite) and the WAR URL ((
/DemoWebsite/DemoWebsite.war) in the text boxes. Fill in the text boxes as I've done. Then click
http://localhost:8080/DemoWebsite/DateJSP.jspand submit that address to the browser.