Thursday, July 7, 2011

Working with Tomcat Server



This is the initial window shown when you Install Tomcat Server. Few of the things be important when you are working with Tomcat Server . Before add any of the Project inside Tomcat server you need to restart the services.








You can restart the service using following step
1. Got to Start menu
2. click on Run
3. Enter services.msc and click on OK Button
4. Service Window get opened like








Now the important point arises how you test Tomcat is Successfully installed in your Machine / System or not . So do one thing please hit following URL on your IE or other Browser

http://localhost:8082/

Where 8082 is your port where server is running right now . By Default Apache Tomcat Server is installed on 8080 Port. if everything is going right then following window is displayed :)




Now Tomcat Server installation test succeed . Your Tomcat server is running in your PC. gr8









-> Now we learn how to configure a Project inside Tomcat Server

Point 1. How can we change a port of Tomcat Server ?

So go with path (i am putting here deafult location of server.xml, if your installation is on different drive then you look for there)

path is : C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml

server.xml is look alike -





Point 2. Configure your application inside Tomcat . it's really funny dear just copy your application folder and paste inside webapps folder

following path is where you need to diploy your application:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps


oops what you did , you copy all your project now we need to understand how can we protect our jsp file and other files . So this is the second option, you can deploy your application in WAR file format. So there is the command when your application convert into war file-


jar -cf Application_Name.war *.*












Then come to your browser window .Now just open the Tomcat Manager . where you can see your application is hosted here . Look the following screenshot














WAR file deployed option available inside Tomcat Manager Link . Here is Screenshot available -













If dear everything is going right then your application is ready to host with Tomcat server . Wow finally you can see it .






So may be this is very helpful.

Happy Learning !!!!!