1

I tried to deploy my application file to Tomcat 7. I have successfully deployed them, but I can see my files only under http://example.com:8080/myproject/index. (Assume that my project folder is myproject and my domain is example.com.)

I would like to to access to my domain like this: http://example.com/index.

How can I do that?

TRiG
  • 10,148
  • 7
  • 57
  • 107
hsnclk
  • 77
  • 2
  • 12

1 Answers1

1

ok I have solved the problem.

in the default server.xml file 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="example.com" unPackWars="true" autoDeploy="true">             
    <Context path="" docBase="myproject" debug="0" reloadable="true"/>
  </Host>
  <Host appBase="webapps" name="www.example.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:)

hsnclk
  • 77
  • 2
  • 12