Managing Tomcat localhost directories in Ubuntu

Recently I installed Apache Tomcat Server to work with JavaServer Pages. I was trying to identify the localhost directory of the server (the directory similar to /var/www in Apache PHP server).
Later I learned that it is very easy to set our own localhost project directory.
Here are the steps:

Go to /etc/tomcat6/Catalina/localhost and create a .xml file with the name of your webapp.
Suppose your webapp is testwebapp, create a file named testwebapp.xml

Now add the following lines to the XML file.
<Context path=“/testwebapp” docBase=“path to the directory where source files are located” />

Now open the web browser and type http://localhost:8080/testwebapp to load the index.jsp file (Server restart may be required).


3 thoughts on “Managing Tomcat localhost directories in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s