1

I have downloaded apache-tomcat-7.0.65.tar.gz from here.

I extracted, and started using startup.sh as follows

arul@arul-pc:~$ chmod +x /usr/local/apache-tomcat-7.0.65/bin/startup.sh 
arul@arul-pc:~$ cd /usr/local/apache-tomcat-7.0.65/bin/
arul@arul-pc:/usr/local/apache-tomcat-7.0.65/bin$ ./startup.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-7.0.65
Using CATALINA_HOME:   /usr/local/apache-tomcat-7.0.65
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.65/temp
Using JRE_HOME:        /usr/bin
Using CLASSPATH:       /usr/local/apache-tomcat-   7.0.65/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.65/bin/tomcat-juli.jar
Tomcat started.
arul@arul-pc:/usr/local/apache-tomcat-7.0.65/bin$

But, when I tried to open in browser using http://localhost:8080/ am getting an error connection refused.

webpage is not available

How to solve this?

EDIT 1:

Result, for ps -ef | grep java

arul@arul-pc:~$ ps -ef | grep java
arul      4404  4373  0 11:04 pts/2    00:00:00 grep --color=auto java

EDIT 2:

Results,

arul@arul-pc:~$ which java
/usr/bin/java
arul@arul-pc:~$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
arul@arul-pc:~$ cd /usr/local/apache-tomcat-7.0.65/logs/
arul@arul-pc:/usr/local/apache-tomcat-7.0.65/logs$ ls
catalina.out
arul@arul-pc:/usr/local/apache-tomcat-7.0.65/logs$

And when I open catalina.out,

/usr/bin/bin/java: not found

14
  • did you check application process is running or not with given port ? what does the log file say ?
    – PKumar
    Oct 21, 2015 at 10:06
  • how to check it ? arul@arul-pc:~$ netstat -a | grep 8080 when I try this no response...
    – A J
    Oct 21, 2015 at 10:08
  • $sudo netstat -a | grep 8080 if it do not show any result then for java ps -ef | grep java process
    – PKumar
    Oct 21, 2015 at 14:09
  • @PKumar, I updated the result for ps -ef | grep java in question, please take a look
    – A J
    Oct 27, 2015 at 5:37
  • Java process is not running before starting tomcat run this commands which java and java -version then check the log files must be located in /usr/local/apache-tomcat-7.0.65/log
    – PKumar
    Oct 27, 2015 at 7:36

1 Answer 1

4

Tomcat runs java by creating a _RUNJAVA variable in setclasspath.sh. This is made up by appending /bin/java to the JRE_HOME environment variable. Your JRE_HOME is currently set to /usr/bin. So you need to modify the JRE_HOME to be /usr instead.

You can override it for the startup.sh script by prepending it like so:

JRE_HOME=/usr ./startup.sh

If you want to modify the JRE_HOME permanently across the system add it to, or edit /etc/environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .