LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-05-2010, 07:33 PM   #1
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Rep: Reputation: 0
Start Tomcat Server Remotely


Hi,

I am trying to start remote tomcat server, it's not working as expected.
I like to mansion that..I am able to stop tomcat server remotly.

Below command i am using
ssh -t remoteserver sudo sh /opt/tomcat/6.0.29/apache-tomcat/bin/catalina.sh start

ssh -t remoteserver sudo sh /opt/tomcat/6.0.29/apache-tomcat/bin/startup.sh

Both are not working..when i run this script locally it's working file

same way when i run tomcat stop command it's working fine.
ssh -t remoteserver sudo sh /opt/tomcat/6.0.29/apache-tomcat/bin/catalina.sh stop

ssh -t remoteserver sudo sh /opt/tomcat/6.0.29/apache-tomcat/bin/shutdown.sh

I check log file also..when i am executing tomcat start there is no log entry in log file

Using CATALINA_BASE: /opt/tomcat/6.0.29/apache-tomcat-6.0.29
Using CATALINA_HOME: /opt/tomcat/6.0.29/apache-tomcat-6.0.29
Using CATALINA_TMPDIR: /opt/tomcat/6.0.29/apache-tomcat-6.0.29/temp
Using JRE_HOME: /usr/local
Using CLASSPATH: /opt/tomcat/6.0.29/apache-tomcat-6.0.29/bin/bootstrap.jar


Thanks in advance.

Regards
Bhaumik
 
Old 08-06-2010, 03:30 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
You can create a script to set the needed env. variables before trying to start tomcat. E.g /opt/tomcat/6.0.29/remote.sh:
Code:
#!/bin/sh
export JAVA_HOME=/usr/local
export CATALINA_HOME=/opt/tomcat/6.0.29/apache-tomcat-6.0.29
/opt/tomcat/6.0.29/apache-tomcat/bin/startup.sh
Then you can start tomcat from ssh:
Code:
ssh -t remoteserver sudo sh /opt/tomcat/6.0.29/remote.sh
 
Old 08-06-2010, 11:26 AM   #3
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Thanks for your reply,

I tried with setting tomcat6 is setting environment.

ssh -t remoteserver sudo /etc/init.d/tomcat6 stop
I tried

Stop is working fine but Start start is not working.

ssh -t remoteserver sudo /etc/init.d/tomcat6 start


Regards
Bhaumik
 
Old 08-06-2010, 12:28 PM   #4
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Start Tomcat remotely...

Hi,
I tried to create remote script which is setting all env variable...

than also tomcat is not starting.....

ssh -t remoteserver sudo sh remote.sh
I am seeing log on console

Using CATALINA_BASE: /opt/tomcat/apache-tomcat-6.0.29
Using CATALINA_HOME: /opt/tomcat/apache-tomcat-6.0.29
Using CATALINA_TMPDIR: /opt/tomcat/apache-tomcat-6.0.29/temp
Using JRE_HOME: /usr/java/jre-1.6.0-sun
Using CLASSPATH: /opt/tomcat/apache-tomcat-6.0.29/bin/bootstrap.jar

Than also it's not starting...
 
Old 08-06-2010, 04:18 PM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
How do you know it's not starting.
The startup.sh output looks ok.
 
Old 08-09-2010, 11:09 AM   #6
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Start Tomcat Server Remotely

That's correct,

But when hit from [ web url] http://servername:8080/[/url] I am not able to see tomcat web console.

Regards
Bhaumik

Last edited by bhaumik; 08-09-2010 at 11:10 AM.
 
Old 08-09-2010, 12:11 PM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Could be a firewall blocking port 8080
Log into the remoteserver and check if tomcat is running and listening on that port.
Code:
netstat -tanpl|grep 8080
 
Old 08-09-2010, 12:51 PM   #8
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Start Tomcat Server Remotely

Tomcat is working fine on remote server port 8080
 
Old 08-09-2010, 01:09 PM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
So if tomcat is running, but you cannot access it with your browser, you have to open port 8080/tcp on the firewall running at the remote server.
 
Old 08-09-2010, 01:27 PM   #10
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Start Tomcat Server Remotely

Sorry for confusation,

Tomcat Start/Stop working fine locally ,

but When I tried remote end IT's not working.

Last edited by bhaumik; 08-09-2010 at 01:28 PM.
 
Old 08-09-2010, 01:38 PM   #11
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Open a shell on the remote server and run:
Code:
tail -f /opt/tomcat/apache-tomcat-6.0.29/logs/catalina.out
Then try to start tomcat remotely and watch the output of the above command to see what happens
 
Old 08-09-2010, 01:48 PM   #12
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
I execute this command, But I am not seeing any log in server,
When I run that command..I am seeing below....

$ tail -f /opt/tomcat/6.0.29/apache-tomcat-6.0.29/logs/catalina.out

Aug 9, 2010 11:40:26 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Aug 9, 2010 11:40:26 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 397 ms
Aug 9, 2010 11:41:08 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Aug 9, 2010 11:41:09 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Aug 9, 2010 11:41:09 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
 
Old 08-09-2010, 02:12 PM   #13
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Quote:
Aug 9, 2010 11:40:26 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Aug 9, 2010 11:40:26 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 397 ms
Here tomcat was running. How was it started?
Quote:
Aug 9, 2010 11:41:08 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Aug 9, 2010 11:41:09 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Aug 9, 2010 11:41:09 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
This logs is for shutdown.
Leave the tail command running and try to start tomcat remotely ssh
 
Old 08-09-2010, 06:14 PM   #14
bhaumik
LQ Newbie
 
Registered: Aug 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Start Tomcat Server Remotely

I did but not getting any log when i hit from remote.
 
Old 08-10-2010, 12:47 AM   #15
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,897

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
What it the ssh command you're running?
Try with:
Code:
ssh remoteserver sudo /opt/tomcat/6.0.29/apache-tomcat/bin/remote.sh
where remote.sh is the script of post #2
 
  


Reply

Tags
remote, start, tomcat6


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tomcat hang when start with "service tomcat start" zcwlinux Linux - Server 2 07-03-2009 10:45 AM
How to make Tomcat 4.0.1 and Tomcat 5.0.28 coexist in one server? g18397 Linux - Software 0 05-16-2006 03:16 AM
start X remotely blas Linux - General 1 09-21-2005 05:14 AM
How can I start X remotely? kleptophobiac Linux - Software 1 08-06-2003 09:16 PM
tomcat on start up mikeshn Linux - Software 1 09-02-2002 11:35 AM


All times are GMT -5. The time now is 08:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration