Discussion:
Installing tomcat 6
Franz
2014-02-04 20:04:18 UTC
Permalink
Hi
I am a very beginner trying to get a VPS working with Centos 6.5 and Tomcat
6.0.39. I already reinstalled the server 3 times and am almost desperate,
so am even willing to pay someone who helps me.

Tomcat 6 is required by openemm.org for a mailing lists and newsletters.
And I am ready with a Creative Commons newsletter.

Openemm.org provides an installation tutorial:
http://sourceforge.net/projects/openemm/files/OpenEMM%20documentation/Documentation%20%28latest%20versions%29/OpenEMM-2013_InstallAdminGuide_1.1.pdf/download

So I am following this tutorial that teaches how to install latest Java
JDK7 first and Tomcat after as follows:

Download the latest binary distribution of Tomcat release 6 from
http://tomcat.apache.org. The core package is sufficient. The
examples here use Tomcat 6.0.32 you should adapt them to the latest
version of Tomcat 6 as needed:

mkdir -p /opt/openemm
cp apache-tomcat-6.0.32.tar.gz /opt/openemm
cd /opt/openemm
tar -xvzf apache-tomcat-6.0.32.tar.gz
ln -s apache-tomcat-6.0.32 tomcat
If you want to make sure that Tomcat works, enter the following commands:

export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh

this command gives for me:
[***@ns3098622 tomcat]# bin/startup.sh
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
[***@ns3098622 tomcat]#

Then I am supposed to test it with http://localhost:8080 which in my case
should be the address of my VPS I suppose: 94.23.44.200:8080 which is not
reachable.

Then the tutorial suggests to shutdown Tomcat with
bin/shutdown.sh:

[***@ns3098622 tomcat]# bin/shutdown.sh
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/bin/catalina.sh: line 421:
"/opt/openemm/java"/bin/java: No such file or directory

So here I am getting an error, but am confused with this error.

So please help me.
If it is of any relevance the step before Tomcat was to install Java, that
worked as expected from the tutorial:

mkdir -p /opt/openemm
cp jdk-7u25-linux-i586.tar.gz /opt/openemm
cd /opt/openemm
tar -xvzf jdk-7u25-linux-i586.tar.gz
ln -s jdk1.7.0_25 java

Then, to test the JDK:
/opt/openemm/java/bin/java -version
I get:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Server VM (build 23.25-b01, mixed mode)
So Java works as expected.

best
Franz
Mark Thomas
2014-02-04 20:08:31 UTC
Permalink
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
At this point use:
bin/catalina.sh run

rather than
bin/startup.sh

and report here what output you get.

Mark
Franz
2014-02-04 20:13:23 UTC
Permalink
Post by Mark Thomas
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
bin/catalina.sh run
rather than
bin/startup.sh
and report here what output you get.
[***@ns3098622 tomcat]# bin/catalina.sh run
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
bin/catalina.sh: line 305:
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or directory
bin/catalina.sh: line 305: exec:
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No such
file or directory

thanks
franz
Franz
2014-02-04 20:23:00 UTC
Permalink
Post by Franz
Post by Mark Thomas
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
bin/catalina.sh run
rather than
bin/startup.sh
and report here what output you get.
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or directory
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No such
file or directory
thanks
But I do not understand what this error means and what I should do now
best
Franz
Daniel Mikusa
2014-02-04 20:43:08 UTC
Permalink
Post by Franz
Post by Franz
Post by Mark Thomas
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
bin/catalina.sh run
rather than
bin/startup.sh
and report here what output you get.
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or directory
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No such
file or directory
thanks
But I do not understand what this error means and what I should do now
You’re setting JAVA_HOME as “/opt/openemm/java”, quotes included. Try setting it without quotes.

Ex: export JAVA_HOME=/opt/openemm/java

Also make sure that you can run the command "/opt/openemm/java/bin/java -version”. You should get the version info for your JVM.

Dan
Post by Franz
best
Franz
Franz
2014-02-04 22:38:59 UTC
Permalink
Post by Franz
Post by Franz
Post by Franz
Post by Mark Thomas
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
bin/catalina.sh run
rather than
bin/startup.sh
and report here what output you get.
Using CATALINA_BASE: /opt/openemm/tomcat
Using CATALINA_HOME: /opt/openemm/tomcat
Using CATALINA_TMPDIR: /opt/openemm/tomcat/temp
Using JRE_HOME: "/opt/openemm/java"
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or
directory
Post by Franz
Post by Franz
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No
such
Post by Franz
Post by Franz
file or directory
thanks
But I do not understand what this error means and what I should do now
You're setting JAVA_HOME as "/opt/openemm/java", quotes included. Try
setting it without quotes.
Ex: export JAVA_HOME=/opt/openemm/java
Yes, it works!! This was the problem: the quotes! Many thanks
Post by Franz
Also make sure that you can run the command "/opt/openemm/java/bin/java
-version". You should get the version info for your JVM.
Yes this works too
best Franz
Christopher Schultz
2014-02-04 23:31:46 UTC
Permalink
Dan,
Post by Daniel Mikusa
Post by Franz
export JAVA_HOME="/opt/openemm/java" cd tomcat
bin/startup.sh
At this point use: bin/catalina.sh run
rather than bin/startup.sh
and report here what output you get.
/opt/openemm/tomcat/bin/bootstrap.jar bin/catalina.sh: line
305: /opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot
execute: No such file or directory
thanks
But I do not understand what this error means and what I should do now
You’re setting JAVA_HOME as “/opt/openemm/java”, quotes included.
Try setting it without quotes.
Quotes should be fine, as long as you are using plain-old
double-quotes and not "smart" (aka dumb) quotes.
Post by Daniel Mikusa
Ex: export JAVA_HOME=/opt/openemm/java
Also make sure that you can run the command
"/opt/openemm/java/bin/java -version”. You should get the version
info for your JVM.
+1

I suspect Java is not actually installed in /opt/openemm/java

- -chris
Franz
2014-02-05 02:41:17 UTC
Permalink
On Tue, Feb 4, 2014 at 9:31 PM, Christopher Schultz <
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Dan,
Post by Franz
Post by Franz
export JAVA_HOME="/opt/openemm/java" cd tomcat
bin/startup.sh
At this point use: bin/catalina.sh run
rather than bin/startup.sh
and report here what output you get.
/opt/openemm/tomcat/bin/bootstrap.jar bin/catalina.sh: line
305: /opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot
execute: No such file or directory
thanks
But I do not understand what this error means and what I should do now
You're setting JAVA_HOME as "/opt/openemm/java", quotes included.
Try setting it without quotes.
Quotes should be fine, as long as you are using plain-old
double-quotes and not "smart" (aka dumb) quotes.
Post by Franz
Ex: export JAVA_HOME=/opt/openemm/java
Also make sure that you can run the command
"/opt/openemm/java/bin/java -version". You should get the version
info for your JVM.
+1
I suspect Java is not actually installed in /opt/openemm/java
Installed? The tutorial steps that I reported in the first email only copy
the files in directory /opt/openemm/java. Nothing was really installed. But
it works just with this export JAVA_HOME=/opt/openemm/java step. Also the
test of java -version works. Are there any problems with the lack of an
actual java installation?
Best
Franz


- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJS8XhiAAoJEBzwKT+lPKRYPjMP/iWOIj45dxg8Jq6ek479x0LH
g6Fq69Bpyid6JvXFgJAYB2s7/1nvbBkpAq0lHhbl0/OglLygqNRNcNQnlDFSsbqd
joq3h24lq6X+RGxV6lFhptGHYlVefcwvl5iCtq4StXgYWqUCtLsIGvmcG3jg7h7U
GhBOenwWZhOGZSjfcPgDQWItFdgKfvLFr4wgpCOXORailxfgLpIAsjAKd7iGxuGc
AiXRNAGrVEUqhAYoOVdvrcaN9QYHjtf3vHRU8Q7DU6NHBqvD5/++A7kjEeY6kaoB
BxF/M2VLyLLSrsTYCqhDt1RbMTVLb7n5dZLefYAnbbKLjHYpSIItAmaFCRojotaK
giTekxYNsfrJlygSmBBNc4iKMzwSqxjKAJ+5OdkiLMDkJlT4cKL47HYIfOHZ8Q2g
aEO4l/EibrmB1Uc1h8EGmoBSEBPPDY1aeBHaaWudTOWcLC4xJAwNyWx9azikU1oK
JeYSkHt6Clo31aJ5rmgSSsd5/iD8b+EkU0yJFTQz8NIV7/Momycfo3Dqb/X9VBZf
mItbfbj2UqitSTvAFTkql3T2RK1dnpBBfwKgaDWZ5WH9aCqGjrN9hTjLnbVFwXSZ
EuZEVe/VTsh5lIGAcnlacfXczaUj4bLaNIsJOzu8IQ1Mj1LMNPbZTs09MCc24yjD
wLomd3DuPNA45enzwBbc
=Pu8H
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
Christopher Schultz
2014-02-05 20:17:21 UTC
Permalink
Franz,
Post by Franz
On Tue, Feb 4, 2014 at 9:31 PM, Christopher Schultz <
Dan,
Post by Franz
Post by Franz
Post by Franz
On Tue, Feb 4, 2014 at 6:08 PM, Mark Thomas
export JAVA_HOME="/opt/openemm/java" cd tomcat
bin/startup.sh
At this point use: bin/catalina.sh run
rather than bin/startup.sh
and report here what output you get.
Using CATALINA_BASE: /opt/openemm/tomcat Using
CATALINA_HOME: /opt/openemm/tomcat Using
CATALINA_TMPDIR: /opt/openemm/tomcat/temp Using
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot
execute: No such file or directory
thanks
But I do not understand what this error means and what I
should do now
You're setting JAVA_HOME as "/opt/openemm/java", quotes
included. Try setting it without quotes.
Quotes should be fine, as long as you are using plain-old
double-quotes and not "smart" (aka dumb) quotes.
Post by Franz
Post by Franz
Ex: export JAVA_HOME=/opt/openemm/java
Also make sure that you can run the command
"/opt/openemm/java/bin/java -version". You should get the
version info for your JVM.
+1
I suspect Java is not actually installed in /opt/openemm/java
Post by Franz
Installed? The tutorial steps that I reported in the first email
only copy the files in directory /opt/openemm/java. Nothing was
really installed. But it works just with this export
JAVA_HOME=/opt/openemm/java step. Also the test of java -version
works. Are there any problems with the lack of an actual java
installation?
Yes, without Java you cannot run Tomcat. Since you have set
JAVA_HOME=/opt/openmm/java, you'd better have a Java available under
/opt/openemm/java.

- -chris

Neven Cvetkovic
2014-02-04 21:08:25 UTC
Permalink
Post by Franz
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or directory
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No such
file or directory
Franz,

I assume you followed instructions for installation:
http://sourceforge.net/projects/openemm/files/OpenEMM%20documentation/Documentation%20(latest%20versions)

Did you test if Java (JDK) was properly set: (pg 4/27 of the installation
guide), e.g.

/opt/openemm/java/bin/java -version

You need to make sure JDK is installed properly, because Tomcat needs it :)

Daniel already pointed out you are probably not properly setting up
JAVA_HOME, try without quotes (pg 5/27 of manual suggests using quotes),
e.g.

export JAVA_HOME=/opt/openemm/java
/opt/openemm/tomcat/bin/catalina.sh run

(CTRL+C to stop the process)

What does the output say? Was it successfully loaded?

After you get it working with catalina.sh run, you probably want to do the
following as well:
1) setup JAVA_HOME somewhere in the profile scripts (e.g. create
/etc/profile.d/java.sh file)
2) configure tomcat as a centos service (chkconfig+rc.d script), so it
starts up automatically when you reboot your system.


Good luck!
Franz
2014-02-04 23:22:23 UTC
Permalink
On Tue, Feb 4, 2014 at 7:08 PM, Neven Cvetkovic
Post by Franz
Post by Franz
Post by Franz
export JAVA_HOME="/opt/openemm/java"
cd tomcat
bin/startup.sh
Using CLASSPATH: /opt/openemm/tomcat/bin/bootstrap.jar
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: No such file or
directory
Post by Franz
/opt/openemm/tomcat/"/opt/openemm/java"/bin/java: cannot execute: No such
file or directory
Franz,
http://sourceforge.net/projects/openemm/files/OpenEMM%20documentation/Documentation%20(latest%20versions)
Did you test if Java (JDK) was properly set: (pg 4/27 of the installation
guide), e.g.
/opt/openemm/java/bin/java -version
You need to make sure JDK is installed properly, because Tomcat needs it :)
Yes this works.
Post by Franz
Daniel already pointed out you are probably not properly setting up
JAVA_HOME, try without quotes (pg 5/27 of manual suggests using quotes),
e.g.
export JAVA_HOME=/opt/openemm/java
/opt/openemm/tomcat/bin/catalina.sh run
(CTRL+C to stop the process)
What does the output say? Was it successfully loaded?
Yes everything works many thanks. I am able to access the page with the
browser. You guys are very helpful.
Post by Franz
After you get it working with catalina.sh run, you probably want to do the
1) setup JAVA_HOME somewhere in the profile scripts (e.g. create
/etc/profile.d/java.sh file)
yes, unfortunately openemm tutorial says nothing about that. Now there is
not java.sh file there. So you mean creating a java.sh file with inside
only:

export JAVA_HOME=/opt/openemm/java

and what does it? Does it setup JAVA_HOME once and for all?

2) configure tomcat as a centos service (chkconfig+rc.d script), so it
Post by Franz
starts up automatically when you reboot your system.
This seems complicated too. Does it means preparing a file tomcat.sh in
/etc/rc.d containing:

/opt/openemm/tomcat/bin/startup.sh

?

many thanks again
Franz
Neven Cvetkovic
2014-02-05 01:08:36 UTC
Permalink
Post by Neven Cvetkovic
http://sourceforge.net/projects/openemm/files/OpenEMM%20documentation/Documentation%20(latest%20versions)
Post by Neven Cvetkovic
After you get it working with catalina.sh run, you probably want to do
the
Post by Neven Cvetkovic
1) setup JAVA_HOME somewhere in the profile scripts (e.g. create
/etc/profile.d/java.sh file)
yes, unfortunately openemm tutorial says nothing about that. Now there is
not java.sh file there. So you mean creating a java.sh file with inside
export JAVA_HOME=/opt/openemm/java
Yes, something along those lines.

Edit a new file in /etc/profile.d/java.sh, e.g.

#
# /etc/profile.d/java.sh
#
export JAVA_HOME=/opt/openemm/java
export PATH=${PATH}:${JAVA_HOME}/bin

- This script does two things:
1) sets $JAVA_HOME for your JDK
2) updates $PATH so your $JAVA_HOME/bin is on the PATH (i.e. Java can be
invoked from any directory)
Post by Neven Cvetkovic
and what does it? Does it setup JAVA_HOME once and for all?
2) configure tomcat as a centos service (chkconfig+rc.d script), so it
Post by Neven Cvetkovic
starts up automatically when you reboot your system.
This seems complicated too. Does it means preparing a file tomcat.sh in
/opt/openemm/tomcat/bin/startup.sh
Yes, something like that ...

1. Create /etc/rc.d/init.d/tomcat.sh (I will see to find some examples),
here's a minimal example:

#!/bin/bash
#
# /etc/rc.d/init.d/tomcat.sh
#
# description: Tomcat Startup, Stop, Restart Script
# processname: tomcat
# chkconfig: 234 20 80

# Test if JAVA_HOME is already set
if [ "x$JAVA_HOME" = "x" ]
then
export JAVA_HOME=/opt/openemm/java
export PATH=$PATH:$JAVA_HOME/bin
fi

# Set Tomcat home directory
CATALINA_HOME=/opt/openemm/tomcat

case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0

- here you would probably want to add a more sophisticated script that adds
/var/run/tomcat/id PID file, kills process if it hangs, etc...
- Can anyone else provide some of their example scripts?

2. Add a tomcat service, e.g.

chkconfig -add tomcat
chkconfig tomcat on

3. Test your service, e.g.

service tomcat stop
service tomcat start
service tomcat restart
Loading...