sunraincyq
sunraincyq

Reputation: 664

http://localhost:8080/ Access Error: 404 -- Not Found Cannot locate document: /

I'm really very new to this Tomcat stuff. I downloaded Tomcat 7.0 windows installer and installed it using the default configuration. After installing, I typed localhost:8080 in my browser to see if Tomcat is working. However,it showed error message like this: Access Error: 404 -- Not Found Cannot locate document: / And there's nothing else show with Tomcat or Apache words in the page. It seems Tomcat not responding.

I googled and searched this forum, but so far the solutions people provided didn't work for me.

  1. checked the server.xml file, 8080 is the HTTP connector port:

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

  2. I did run the Tomcat7.exe in the \bin folder. Something run in the command window and disappeared then. Nothing changed then.

  3. I set some environment system variables like JAVA HOME, PATH, and CLASSPATH according to some tutorials online.

Still not work. Only things I'm suspicious are: 1. I have two JRE folder: jre6 and jre7 in the program files directory. Tomcat7 chose the jre7 one. 2. I installed anyother server called Wamp server, which I used to learn some PHP programming with SQL usage. There's Apache in the package. Not sure if it's using 8080 port.

Please help. I've already digged online more than 2hrs for this headache. Any comments are welcome.

Upvotes: 12

Views: 154659

Answers (6)

Skippy le Grand Gourou
Skippy le Grand Gourou

Reputation: 7714

For CentOS users (at least), one will also get a 404 error trying to access the server on port 8080 on a fresh install if the tomcat-webapps package is not installed.

Upvotes: 1

Uddhav P. Gautam
Uddhav P. Gautam

Reputation: 7636

You can run below commands. I believe this is what you want!

Note: Make sure the port 8080 is open. If not, kill the process that is using 8080 port using sudo kill -9 $(sudo lsof -t -i:8080)

 ./catalina.sh run

Upvotes: 1

Ayoub
Ayoub

Reputation: 258

your 8080 port is already used by another application 1/ you can try to find out which app is using it, using "netstat -aon" and stop the process; 2/ you can go to server.xml and change from port 8080 to another one (ex: 8081)

Upvotes: 1

Koshinae
Koshinae

Reputation: 2320

A tip for others: if you have NI applications installed, the NI Application Web Server also uses the port 8080.

Upvotes: 25

user4223521
user4223521

Reputation: 231

When I had an error Access Error: 404 -- Not Found I fixed it by doing the following:

  1. Open command prompt and type "netstat -aon" (without the quotes)
  2. Search for port 8080 and look at its PID number/code.
  3. Open Task Manager (CTRL+ALT+DELETE), go to Services tab, and find the service with the exact PID number. Then right click it and stop the process.

Upvotes: 23

sunraincyq
sunraincyq

Reputation: 664

I think I figured out the questions after reading the log. Thanks to Will's reminder, I checked the log and found out the some program else is listening to that port. Before I can start to figure out which program, my computer was restarted and localhost:8080 works and showing tomcat page. Whooh

Upvotes: 4

Related Questions