Wednesday, 24 October 2012

Deployment in Tomcat Apache Server

  1. Export the project in WAR file by selecting the project to deploy -> Export -> WAR file

    Select Project > Export >  WAR file
    Export project as WAR
  2. There are two ways to deploy WAR file in Apache Tomcat Server.First is through tomcat manager.The steps to deploy WAR from tomcat manager is described below:-
    1.            Open tomcat-users.xml present at  appBase location(default appBase is "$CATALINA_BASE)/config or from eclipse go to server >Tomcat v6.0 Server at localhost-config and add user with manager role.For Ex:- Add the following line
      <user username="admin" password="admin" roles="manager"/>

    2. Start the tomcat server by executing startup.bat file present at bin folder of apache-tomcat.Open the Apache Manager by clicking http://localhost:8080 and select Tomcat Manager.   
      Apache tomcat manager
      Enter user name and password created using tomcat-users.xml.For our case it will be :-

      Username = “admin”

    3. Upload WAR file as shown below.
      Add WAR file
      Add WAR file

  3. Deployment on Tomcat startup
    1. The location you deploy web applications to for this type of deployment is called the appBase which is specified per Host. Copy the WAR file to be deployed to appBase location.(default appBase is "$CATALINA_BASE/webapps").This method will work only if Host's deployOnStartup attribute is "true".

No comments:

Post a Comment