Question

About Deploying Java Application to Tomcat

Hi I tried to deploy my application file to tomcat and I have succeed to deploy them but only I can see my files under http://mydomain.com:8080/myproject/index assume that my project folder is = myproject my domain is = mydomain.com

Anyway Only I try to access to my domain like these

http://mydomain.com/index http://www.mydomain.com/index

How can I do like that ?

Regards

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

ok I have solved the problem.

in the default server.xml file host-tag like this,

<Host name="localhost" appBase="webapps"
     unpackWARs="true" autoDeploy="true">

    <!-- SingleSignOn valve, share authentication between web applications
     Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
     Documentation at: /docs/config/valve.html
     Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
       prefix="localhost_access_log." suffix=".txt"
       pattern="%h %l %u %t &quot;%r&quot; %s %b" />
  </Host>

but I have removed that and changed like these

<Host appBase="webapps" name="mydomain.com" unPackWars="true" autoDeploy="true">             
    <Context path="" docBase="myproject" debug="0" reloadable="true"/>
  </Host>
  <Host appBase="webapps" name="www.mydomain.com" unPackWars="true" autoDeploy="true">            
    <Context path="" docBase="myproject" debug="0" reloadable="true"/>
  </Host>

and than I have changed

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

like this

<Connector port="80" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />

now it works:)