0

This question should have been answered here, but I had to ask again because the resolution was inconclusive.

I am trying to configure my Tomcat's server.xml to work on TCP 8080 port. But it's always failing because the port 8080 is being used. I tried to run netstat -ano to find out what was using port 8080 and it seemed to be Firefox at that time (yes, it confuses me too). When I did this http://localhost, I got a 404 whereas doing http://localhost:8080/ the address was working okay. The problem becomes apparent when I clik logout on my sample web application and it looks for localhost/?logout page. I can force the link to find localhost:8080/?logout, but this is a bodge, not a proper fix.

Does anyone know a solution to this problem?

closed as unclear what you're asking by Ramhound, psusi, Art Gertner, bwDraco, mdpc Apr 22 '15 at 6:17

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • http://localhost would send the browser to localhost port 80, not 8080. You say you get a 404 from that URL. So apparently something is listening on port 80. Maybe some other web server is supposed to be acting as a frontend for tomcat here? – Kenster Apr 20 '15 at 20:08
  • As for firefox, what makes you think it's listening on port 8080? Maybe you could edit your question to include whatever evidence you have for that? – Kenster Apr 20 '15 at 20:10
  • @Kenster It's a part of a commercial application and I cannot add any graphical evidence....... the problem is simply the address; localhost doesn't resolve to anything, but localhost:8080does.....and this is an SCM maintained app, so other developers have checked in the correct and working version of the app with the correct server.xml config.....my browser settings are identical to everyone else... – hagubear Apr 20 '15 at 20:17
  • You previously said "when I do this http://localhost, I got a 404". That would mean some kind of HTTP server is listening on port 80 and responding to requests. Now you say "localhost doesn't resolve to anything". This seems to be contradictory. Are you expecting your application to work through the URL without a port number, or with the 8080 version of the URL? – Kenster Apr 20 '15 at 20:21
  • @Kenster..... I tried localhost first....it gave me a 404. Then i tried with 8080 and it gave my the initial login page. Sorry for the contradictory statement. – hagubear Apr 20 '15 at 20:35
2

Run Resource monitor (if you are on windows. since you have not specified your os) by pressing the Windows key and then typing resmon.
Then in the Network tab you can see Listening ports and then check which program is using the port 80. Then take care of that.

If you are on linux, type this in command line:

sudo netstat -tapen | grep ":80 "
1

After some research, I understood what was causing the issue.

When I started Tomcat, the service was trying to bind port 8080 to it's connectors (using service.xml file configs). But SQL server reporting services is the app that I wasn't familiar with. Apparently, MSSQLSERVER reporting services uses port 8080 by default and, if installed as a service already, will do so unless you disable it.

Once I disabled the service, my webapp worked perfectly. This is also a reason why binding it to 8055 was working temporarily (but it was not a logical solution anyway).

Thanks, to @TechLife for his answers :)

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