0

I am using ubuntu-16.04 and have been trying to work with Tomcat. My version is: Apache Tomcat/8.0.36.

I have an app in http://localhost:8080/mynewapp which i wanted to access as root app, that means i want to see my app when i access http://127.0.0.1:8080

Please, help me about it.

1

You have a couple of options:

  1. Remove the out-of-the-box ROOT/ directory from tomcat and rename your war file to ROOT.war before deploying it.

  2. Deploy your war as (from your example) war_name.war and configure the context root in conf/server.xml to use your war file :

    <Context path="" docBase="war_name" debug="0" reloadable="true"></Context>
    

The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.

Source: https://stackoverflow.com/a/5328636/2983312

Also, 127.0.0.1 should resolve to localhost by default. If it does not, you can add an entry to /etc/hosts as root.

127.0.0.1       localhost
  • Thanks. I did succeed by first method (replacinf ROOT with my app). But i am not clear with other one. – Fahad Ahammed Jul 18 '16 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.