0

I've just downloaded a java application called "test-app" that I obtained from http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html and I setup tomcat 7 in eclipse. When I started the server I navigated to http://localhost/test-app and got a page could not be found error, but when I went to http://localhost:8080/test-app/ the page came up correctly. Why is this occurring? The tutorial I'm following states that I should be able to navigate to the page without the 8080.

ConfusedDeer
  • 3,335
  • 8
  • 44
  • 72
  • Here is the solution. http://stackoverflow.com/questions/4756039/how-to-change-the-port-of-tomcat-from-8080-to-80 – James Feb 02 '14 at 21:50

1 Answers1

1

I believe port 8080 is the default port for tomcat installations. There should be a file called conf/server.xml which you can change it from 8080 to 80.

Look in server.xml for this line:

 <Connector port="8080" maxHttpHeaderSize="8192"
           maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true" />

And change Connector port="8080" to Connector port="80"

Phil Cross
  • 9,017
  • 12
  • 50
  • 84
  • Just remember that port 80 need admin privileges, that is why 8080 is default – Leo Feb 02 '14 at 23:09
  • I found the server.xml file, but I eventually modified it through eclipse, by right-clicking on the server, open, and changed 'HTTP' to from 8080 to 80. I was able to navigate to `http://localhost/test-app`. The odd thing is that I changed it back to 8080, back to 80, and back to 8080 again, and I was able to open the test-app at `http://localhost/test-app` with the port set to 8080. – ConfusedDeer Feb 03 '14 at 17:48
  • Odd. I'm not a fan of tomcat, but stumbled on this issue when I had to set up a server with it. Glad it worked for you! – Phil Cross Feb 03 '14 at 21:17