Report this

What is the reason for this report?

About Deploying Java Application to Tomcat

Posted on December 12, 2014

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



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!

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.

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:)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.