sujai

Member
Sep 26, 2003
22
0
151
Errror

Hello,

I am getting this error while starting tomcat


[/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# ./jsvc -Djava.endorsed.dirs=./common/endorsed -cp ./bin/bootstrap.jar -outfile ./logs/catalina.out -errfile ./logs/catalina.err org.apache.catalina.startup.Bootstrap
Unable to redirect to ./logs/catalina.out
Unable to redirect to ./logs/catalina.err
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# jsvc.exec error: Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader
jsvc.exec error: Service exit with a return value of 1


Please help me . I want to install tomcat at any cost
 

sujai

Member
Sep 26, 2003
22
0
151
Alos this

But when i checked the tomcat port., I saw this


/usr/local/java/jakarta-tomcat-5.5.3/bin]# netstat -lpn |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 25379/java


please advice
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,535
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
sujai said:
Hello,

I am getting this error while starting tomcat


[/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# ./jsvc -Djava.endorsed.dirs=./common/endorsed -cp ./bin/bootstrap.jar -outfile ./logs/catalina.out -errfile ./logs/catalina.err org.apache.catalina.startup.Bootstrap
Unable to redirect to ./logs/catalina.out
Unable to redirect to ./logs/catalina.err
[email protected] [/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# jsvc.exec error: Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader
jsvc.exec error: Service exit with a return value of 1


Please help me . I want to install tomcat at any cost

Edit /usr/sbin/starttomcat

Change
Code:
"-Djava.endorsed.dirs=../common/endorsed",
        "org.apache.catalina.startup.Bootstrap",
        "-debug","-outfile","../logs/catalina.out",
        "-errfile","../logs/catalina.err","-verbose","-security");
To
Code:
"-Djava.endorsed.dirs=$ENV{JAKARTA_HOME}/common/endorsed",
        "org.apache.catalina.startup.Bootstrap",
        "-debug","-outfile","$ENV{JAKARTA_HOME}/logs/catalina.out",
        "-errfile","$ENV{JAKARTA_HOME}/logs/catalina.err","-verbose","-security");
 

sujai

Member
Sep 26, 2003
22
0
151
Hello

Hello,

Now that error is gone.. And this is what is got from ps ax |grep tomcat

/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# ps ax |grep tomcat
25379 pts/2 S 0:04 /usr/local/java/j2sdk1.4.2_05//bin/java -Djava.endorsed.dirs=/usr/local/java/jakarta-tomcat-5.5.3//common/endorsed -classpath /usr/local/java/j2sdk1.4.2_05//lib/tools.jar:/usr/local/java/jakarta-tomcat-5.5.3//bin/bootstrap.jar:/usr/local/java/jakarta-tomcat-5.5.3//bin/commons-logging-api.jar
25922 ? S 0:00 jsvc.exec -user tomcat -home /usr/local/java/j2sdk1.4.2_05 -Dcatalina.home=/usr/local/java/jakarta-tomcat-5.5.3 -Djava.io.tmpdir=/var/tmp -outfile /usr/local/java/jakarta-tomcat-5.5.3/logs/catalina.out -errfile &1 -cp /usr/local/java/j2sdk1.4.2_05/lib/tools.jar:/usr/local/java/jakarta-tomcat-
25923 ? S 0:01 jsvc.exec -user tomcat -home /usr/local/java/j2sdk1.4.2_05 -Dcatalina.home=/usr/local/java/jakarta-tomcat-5.5.3 -Djava.io.tmpdir=/var/tmp -outfile /usr/local/java/jakarta-tom

and this is the result of neststat
[/usr/local/jakarta/jakarta-tomcat-5.0.28/bin]# netstat -lpn |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 25379/java


But the pages show this error

HTTP Status 404 - /Hello.jsp

type Status report

message /Hello.jsp

description The requested resource (/Hello.jsp) is not available.
Apache Tomcat/5.0.28


please advice
 

sujai

Member
Sep 26, 2003
22
0
151
server.xml

Hello,

This is the domains entry in server.xml


<Host name="www.sujais.com" appBase="/home/sujais/public_html">
<Context path="" reloadable="true" docBase="/home/sujais/public_html" debug="1"/>
</Host>


I dont know what is the reason for this error
 

sujai

Member
Sep 26, 2003
22
0
151
Working server

Hello,

I another server where tomcat is working this is the status


netstat -lpn |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 7730/jsvc.exec


Is tomcat working on my first server?.
 

sujai

Member
Sep 26, 2003
22
0
151
Hello

Hello,

I got the tomcat server and the examples in the tomcat directory working. So I think its something with server.xml file. Any idea on this. Thanks

--Sujai
 

sujai

Member
Sep 26, 2003
22
0
151
Hello

Hurray.... AT LAST I GOT IT WORKING. I INSTALLED IT MANUALLY AND MADE SOME CHANGES AND NOW ITS WORKING...... Anyway thanks for your prompt reply.


--Sujai
--Logicsupport.com
 

sujai

Member
Sep 26, 2003
22
0
151
Hello

Hello,

Please follow these steps to install tomcat manaually
1. Download Tomcat
====

Downloaded "5.5.3-beta tar.gz" from here:

http://jakarta.apache.org/site/binindex.cgi

Which is this file:

http://apache.ausgamers.com/jakarta/tomcat-5/v5.5.3/bin/jakarta-tomcat-5.5.3.tar.gz

This version of Tomcat likes JDK 2.5, which can be downloaded here:

http://java.sun.com/j2se/1.5.0/download.jsp

If you are going to use JDK 1.4 with Tomcat, also download the compat archive,
"5.5.3-beta Compat tar.gz" which is this file:

http://apache.ausgamers.com/jakarta/tomcat-5/v5.5.3/bin/jakarta-tomcat-5.5.3-compat.tar.gz


2. Unzip Archive
====

Unzipped the archive:

tar xzvf jakarta-tomcat-5.5.3.tar.gz

If you downloaded the compat archive to use Tomcat with JDK 1.4, also unzip the
compat archive from the same directory as the tomcat archive itself - meaning
that the compat archive will unpack itself into the same directory as the
tomcat one just did.

tar xzvf jakarta-tomcat-5.5.3-compat.tar.gz

Remember to save both archives and run both of these tar commands from the same
directory. For example:

/usr/local
# tar xzvf jakarta-tomcat-5.5.3.tar.gz

/usr/local
# tar xzvf jakarta-tomcat-5.5.3-compat.tar.gz

Copied the folder to where I want it installed.

cp jakarta-tomcat-5.5.3 /usr/local/java/jakarta-tomcat-5.5.3




3. Set Environment Variables
====

Edited .bash_profile of "root" user to make sure $CATALINA_HOME was set:

export CATALINA_HOME=/usr/local/java/jakarta-tomcat-5.5.3

You must also make sure JAVA_HOME is set to the installation directory
of your Java installation:

export JAVA_HOME=/usr/java/j2sdk1.4.2_02




4. See Install Documentation
====

Looked at the Tomcat 5.5 Installation docs for Unix:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html




5. Create Daemon Startup Binary
====

As "root", I ran the following commands to make jsvc, which allows Tomcat 5 to
be run as a daemon or background thread:

# Needed if you just edited .bash_profile to add CATALINA_HOME
source ~/.bash_profile

cd $CATALINA_HOME/bin
tar xvfz jsvc.tar.gz
cd jsvc-src
autoconf
# I found ./configure did not have execute rights for root.
chmod +711 ./configure
./configure
make
cp jsvc ..
cd ..




6. Install Startup Script
====

Now that you have the binary, you need a script in place that Linux will
execute when you start up and shut down the OS.

Copied the daemon startup script to init.d:

cp $CATALINA_HOME/bin/jsvc-src/native/Tomcat5.sh \
/etc/rc.d/init.d/Tomcat5

Make sure root can execute it:

chmod +711 /etc/rc.d/init.d/Tomcat5

Put links in the rc5.d directory to make sure the Tomcat5 script was called
at run level 5 startup and shutdown (X windows level):

ln -s /etc/rc.d/init.d/Tomcat5 /etc/rc5.d/S50Tomcat5
ln -s /etc/rc.d/init.d/Tomcat5 /etc/rc5.d/K50Tomcat5

Put links in the rc3.d directory to make sure the Tomcat5 script was called
at run level 3 startup and shutdown (console level):

ln -s /etc/rc.d/init.d/Tomcat5 /etc/rc3.d/S50Tomcat5
ln -s /etc/rc.d/init.d/Tomcat5 /etc/rc3.d/K50Tomcat5

Could (instead) have put an entry in this file:

/etc/rc.local






7. Edit Startup Script
====

Edited Tomcat5.sh to fill in the appropriate details for me. The actual lines I
changed were:

JAVA_HOME=/usr/java/j2sdk1.4.2_03
CATALINA_HOME=/usr/local/java/jakarta-tomcat-5.5.3
DAEMON_HOME=/usr/local/java/jakarta-tomcat-5.5.3
TOMCAT_USER=robertmarkbram

#
# Start Tomcat
#
$DAEMON_HOME/bin/jsvc \


My actual Tomcat5.sh:

#!/bin/sh
##############################################################################
#
# Copyright 2004 The Apache Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
#
# Small shell script to show how to start/stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the server.xml
# file:
#
# <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
# <Connector className="org.apache.catalina.connector.http.HttpConnector"
# port="80" minProcessors="5" maxProcessors="75"
# enableLookups="true" redirectPort="8443"
# acceptCount="10" debug="0" connectionTimeout="60000"/>
#
# That is for Tomcat-5.0.x (Apache Tomcat/5.0)
#
# Adapt the following lines to your configuration
JAVA_HOME=/usr/java/j2sdk1.4.2_03
CATALINA_HOME=/usr/local/java/jakarta-tomcat-5.5.3
DAEMON_HOME=/usr/local/java/jakarta-tomcat-5.5.3
TOMCAT_USER=robertmarkbram
TMP_DIR=/var/tmp
CATALINA_OPTS=
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
start)
#
# Start Tomcat
#
$DAEMON_HOME/bin/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$TMP_DIR \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile '&1' \
$CATALINA_OPTS \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
;;

stop)
#
# Stop Tomcat
#
PID=`cat /var/run/jsvc.pid`
kill $PID
;;

*)
echo "Usage tomcat.sh start/stop"
exit 1;;
esac
##############################################################################




8. Change Port You Run Tomcat On
====

Changed the following in $CATALINA_HOME/conf/server.xml to make Tomcat run on
port 8095 instead of the default 8080:

<Connector port="8095"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />




9. Set Up Admin User
====

Edited $CATALINA_HOME/conf/tomcat-users.xml to give myself a user with
admin and manager roles:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="admin"/>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>

Users with admin role can use the admin tool:

http://localhost:8095/admin

Users with the manager role can use manager tools like this one:

http://localhost:8095/manager/list



10. Reboot
====

Restarted my machine (with fingers crossed).

Run as root:

init 6

Or just log out and reboot!



Thanks
--Sujai
--Logicsupport.com
 

big

Well-Known Member
Aug 12, 2001
224
0
316
Earth
how to enable sites for JSP after installing it from WHM ?

or all sites will be auto-enabled?

i remember the very old tomcat module adds a link at WHM to enable sites for jsp
 

linux-image

Well-Known Member
Jun 8, 2004
1,190
1
168
India
cPanel Access Level
Root Administrator
yes. it does add a link at the WHM. check at:

Account Functions ==> Install Servlets

that does it.
 

big

Well-Known Member
Aug 12, 2001
224
0
316
Earth
anyone knows if its possible to upgrade JDK from 1.4.2 to 1.5.0 ? (a.k.a 5.0) ?

thanks