Tomcat Change Default Web Application

Posted: May 13, 2009 by Narendra Shah in Java Box
Tags: , , , , ,

Today i came to know how to set default webapplication. I mean that when you install tomcat in your system. When you open your-machine-ip:8080 then tomcat application is displayed but to configure your application on first page is really easy.

It is actually loading root application which comes with your tomcat free.

Just add following in your tomcat-dir/conf/server.xml

Search for host tag and put following lines in between.(search <host )

……
<Context path=”” docBase=”iview” debug=”0″ reloadable=”true”>
</Context>
………….

Now one more thing new tomcat(above v5.x) is preserving session between tomcat restart but to stop that you can change tomat-dir/conf/context.xml and un-comment following tag.

<Manager pathname=”” />

You can also change default port for your tomcat. Just change port attribute value to your custome port number in connector tag in server.xml. And you are done.

Comments
  1. Hank says:

    Great solution, I am looking for the solution for a long time, it works for tomcat 6.0.29.

    Like

  2. Steffen says:

    Thanks in a million! I’ve been searching for this for a few days now. This worked out great for me on 7.0.30!

    Like

  3. Juliet says:

    Thanks for your marvelous posting! I truly enjoyed reading it, you might be a great author.
    I will always bookmark your blog and will often
    come back in the foreseeable future. I want to encourage you to definitely continue your great work, have a nice morning!

    Like

  4. I’m not positive the place you are getting your information, however great topic. I needs to spend some time finding out much more or working out more. Thanks for magnificent information I used to be in search of this info for my mission.

    Like

  5. Patricia says:

    Really when someone doesn’t be aware of then its up to other visitors that they will help, so here it occurs.

    Like

  6. I want to share with you link about more advanced Tomcat settings, which you can do using Eclipse IDE:

    http://fruzenshtein.com/tomcat-in-eclipse-how-to/

    I hope it will be useful for you and your readers

    Have a nice day

    Like

  7. mtech-co.com says:

    This is really interesting, You’re an excessively professional blogger. I have joined your rss feed and look ahead to seeking extra of your magnificent post. Also, I have shared your site in my social networks

    Like

  8. Mahesh says:

    but it will creat the duplicate folder when JVM startup ( webapps/appname or webapps/ROOT)

    Like

Leave a reply to Patricia Cancel reply