In 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. This tutorial assumes that you already know how to configure config/tomcat-users.xml in your installation if not, you will have to configure that file. I am using Linux mint 17.1 “Rebbecca” and this is how I configured the config/tomcat-users.xm. First you need to launch Terminal and you can do it by pressing Ctrl+Alt+t and you get something like this:
To edit the config/tomcat-users.xm you will need to use this command:
sudo gedit /etc/tomcat6/tomcat-users.xml
You will need to add the lines above to give access to administrator of the container. Don’t forget to change the password with your own. Finally you will have to restart tomcat6 with this command: sudo service tomcat6 restart
Launch you favorite web browser and key in http://localhost:8080/ in the address bar and press enter: You have the following:
To deploy an application in tomcat you will need to use manager webapp to login. Use the user name and password that we added in the xml file. In this case Username is TomcatAdmin and Password is tcpass. If you are successful to login, you will get something like this:
And now you are ready to deploy your application to the tomcat. Always remember that you can deploy only files that are compressed with an extension of .war and written in Java.
Do you have anything to add to the story? Leave a comment in the comment box.