0
votes

I am new to the development of Web Apps and Web Services. I am trying to install and run Apache tomcat on my local machine.

Here is what I did :

  1. Downloaded tomcat 8 (.tar) from apache's website
  2. Extracted the .tar package and pasted the folder in my home directory (I am working on Ubuntu 12.04)

Here are my terminal prints

ankit@ankit-HCL-Desktop:~/apache-tomcat-8.0.28/bin$ ./startup.sh

Using CATALINA_BASE: /home/ankit/apache-tomcat-8.0.28

Using CATALINA_HOME: /home/ankit/apache-tomcat-8.0.28

Using CATALINA_TMPDIR: /home/ankit/apache-tomcat-8.0.28/temp

Using JRE_HOME: /home/ankit/jdk1.7.0_79

Using CLASSPATH: /home/ankit/apache-tomcat-8.0.28/bin/bootstrap.jar: /home/ankit/apache-tomcat-8.0.28/bin/tomcat-juli.jar

Tomcat started.

Then I typed localhost:8080 in my browser but it displayed

Unable to connect

Firefox can't establish a connection to the server at localhost:8080.

After that I used catalina.sh

ankit@ankit-HCL-Desktop:~/apache-tomcat-8.0.28/bin$ ./catalina.sh start

Using CATALINA_BASE: /home/ankit/apache-tomcat-8.0.28

Using CATALINA_HOME: /home/ankit/apache-tomcat-8.0.28

Using CATALINA_TMPDIR: /home/ankit/apache-tomcat-8.0.28/temp

Using JRE_HOME: /home/ankit/jdk1.7.0_79

Using CLASSPATH: /home/ankit/apache-tomcat-8.0.28/bin/bootstrap.jar:/home/ankit/apache-tomcat-8.0.28/bin/tomcat-juli.jar

Tomcat started.

But still the same result in my broswer.

What am I doing wrong ?

1
Can you check in server.xml to see which port is it listening to ? Also, in logs folder, you can check logs to see whether there are actually any errors.aksappy
@aksappy You are right, indeed the problem was in my server.xml, it was a different port. I had changed it to 9999, when I typed localhost:999, I am able to see the apache Tomcat home page. Thanks a ton !!!Ankit
BTW, is only startup.sh enough or catalina.sh start is also requied ?Ankit
startup.sh calls catalina.sh, after setting up classpath. So, ideally you need to use startup.shaksappy
@aksappy: thanks a lot, please convert your comments into an answer, so that I can accept and others can benefit tooAnkit

1 Answers

1
votes

The issue could be that you have a different port than 8080 in your tomcat server.xml configuration. Please check in server.xml, HTTP 1.1 Connector to see which port the tomcat is listening to.

Also check the logs to see whether there has been any errors while starting up the tomcat (under logs folder).

As to which script to use, use startup.sh / startup.cmd. This file calls catalina script, after setting the required classpath environment.