Here is brief summary of functions of various directories in tomcat
bin : The bin directory contains the shell scripts and batch files for starting . We use mainly startup.sh to start the catalina. Internally it gives call to catalina.sh file to execute. The envorionment variables of JAVA_HOME , CATALINA_HOME are mandatory for tomcat catalina.sh to work.

conf : The conf directory contains the configuration files for Tomcat. These include general server configuration files, a default user list for file-based authentication and security for Web applications, and a global configuration

logs : The <TOMCAT_HOME>/logs directory contains the server logs.

lib : The <TOMCAT_HOME>/lib directory contains all the JAR files used by Tomcat.

webapps : This directory contains all the Web applications provided with Tomcat by default.
work : The work directory contains temporary files, precompiled JSP pages, and other intermediate files.

webapps : This is the place where we will place our war files . Tomcat automatically explodes them into directories. Tomcat also has applications of manager and host-manager which allows us to manage applications and hosts respectively.

To install Tomcat we need Java to be installed in the system. If you want to know how to install Java on Linux you can refer this earlier post on the same.

We can install Java either using packages (apt , yum) or manually. This post explains how to do it manually.

The main advantage of doing it manually is that all the tomcat files are in one location. The automated installation will spread the setup files across various locations. It places the Tomcat configuration files at various non standard places.

Steps

1) Login to shell and go to folder where you want to install tomcat . In this example i am doing it in folder in /usr . The shell commands are shown by # statements , it can be $ for you. It doesn’t matter. If the user with which you are logged in is not root. Then you need to prefix commands with sudo.

We can install Java either using packages or manually. This post explains how to do it manually.

If you want jdk to be available only for particular user , then do it in his home directory. Otherwise if you want to make it available for all the users its better to do it in /usr directory.

Steps

1) Login to shell and go to folder where you want to install jdk . In this example i am doing it in folder in /usr . The shell commands are shown by # statements , it can be $ for you. It doesn’t matter. If the user with which you are logged in is not root. Then you need to prefix commands with sudo.

# cd /usr

# sudo mkdir java

# cd java

Download the latest version of jdk from oracle website. You can also isntall Open jdk . The steps would be more of less same. Just change would be file name and from where to get it.

Go to Oracle website and open the Java downloads page. Click JDK and you will be presented with various files which you can download depending upon your platform. If your machine is 32 bit you would download x86 setup . If its 64 bit then you will download x64 setup.

While working with java web application development often we need to install applications again and again on web server / application server. And often when we deploy application after modification to web.xml application fails to get deployed giving long error in Tomcat ( or any other server) console.

To check validation of web.xml before deploying we can validate it with standard web.xml dtd

I used ant to handle deployment / stopping / starting application in tomcat.

Here are my personal thoughts ( PS : I am not any expert , there are just my own views)

Paper 1

Total questions were 100 , time was 2 hours

Gone are those days when exams were full of Indian history , i feel UPSC has moved on and now they are testing us for current events. People who read papers like The Hindu and Frontline magazine should feel they are on right track to prepare for exam like this. Paper was logical and nothing like what happened in year xxxx bla bla types questions.

This post assumes that you have setup your EC2 account successfully using Amazon Management Console , to obtain Private Key and X502 Certificate. If you are not sure what this mean , just read the other post on getting started with EC2

To setup windows environment for development with Amazon Cloud Computing platform , EC2. We need to follow below steps