LinuxQuestions.org
Help answer threads with 0 replies.
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 04-16-2013, 07:11 AM   #1
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Rep: Reputation: Disabled
How to start and stop the tomcat individual application in linux ??


I have tomcat installed in my linux system, I am able to acces it thru web services and can perform both start and stop of tomcat services in web and in my linux machine.


If i need to start and stop individual application in web we have an option and its easy to perform this operation.

How to start and stop the tomcat individual application in linux ??

Code:
wget “http://useer_id:passwd@IP_Address:8080/manager/stop?path=/Myapp” -O – -q
wget “http://useer_id:passwd@IP_Address:8080/manager/start?path=/Myapp” -O – -q
This command doesnt work

Last edited by jags1984; 04-16-2013 at 10:32 PM.
 
Old 04-17-2013, 02:27 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
try
wget -O /PATH/TO/OUTPUTFILE http://useer_id:passwd@IP_Address:80...op?path=/Myapp

for more detailed help type in bash:
man wget

you can leave the man page by typing q
 
Old 04-17-2013, 03:23 AM   #3
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
wget -O tt.txt http://user_id:passwd@IP_Address:808...op?path=/Myapp

--2013-04-17 13:45:53-- http://user_id:*password*@IP_Address...op?path=/Myapp
Connecting to 10.201.143.73:8181... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-04-17 13:45:53 ERROR 404: Not Found.


Getting the following error, I am running this command in webapps directory
 
Old 04-17-2013, 03:36 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,900

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
For tomcat-6.0.30 and newer you need to use the following URL:
Code:
wget "http://script-manager:password@localhost:8080/manager/text/stop?path=/Myapp" -O - -q
and define in tomcat-users.xml a role and a user like this:
Code:
<role rolename="manager-script"/>
<user username="script-manager" password="password" roles="manager-script"/>
Cheers
 
Old 04-17-2013, 10:01 AM   #5
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
Thanks it works.


Dont we have a command as we do for starting and stopping all services using shell script. ./startup.sh for staring all services and ./shutdown.sh for stopping all srvices in TOMCAT.


Basically I was trying to start and stop individual service this way without any authentication or setup.

Is there a way something like ./startup.sh Myapp
 
Old 04-17-2013, 11:19 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,900

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Quote:
Originally Posted by jags1984 View Post
Dont we have a command as we do for starting and stopping all services using shell script. ./startup.sh for staring all services and ./shutdown.sh for stopping all srvices in TOMCAT.
Basically I was trying to start and stop individual service this way without any authentication or setup.
Is there a way something like ./startup.sh Myapp
There is this python script, but you still need to provide the username and password in command line.
 
Old 04-18-2013, 12:22 AM   #7
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
I am trying to start and stop the services from a client linux machine.

The inputs that are available to me will be start script, stop script, location of the script , webapp directory and Application name (war file).

In the above case I need to set up this python script in all the remote machine and I should also have userid, passwd too.

This is too much task, why cant we start/stop the individual services as we do for the tomcat server using the start/stop script ?
 
Old 04-18-2013, 02:28 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,900

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Quote:
In the above case I need to set up this python script in all the remote machine and I should also have userid, passwd too.
You can install it on a single box and use something like
Code:
tomcat-manager --user=adminA --password=passwdA http://lhostA:8080/manager/text stop /MyApp
tomcat-manager --user=adminB --password=passwdB http://lhostB:8080/manager/text stop /MyOtherApp

Quote:
This is too much task, why cant we start/stop the individual services as we do for the tomcat server using the start/stop script ?
This is how tomcat works. You need a username/password for the manager application that is used to manage all the other apps running on tomcat
 
Old 04-18-2013, 01:09 PM   #9
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
If your TOMCAT is installed in same linux machine then by using above command we will be calling to the same machine thru http again to start/stop application.


I am looking the easier by making use of start/stop script, I dont think admin will be using wget command to do it.

If this how TOMCAT works then there may be some reason apart frm security as we have the scripts that can start and shutdown whole server at one moment.

Last edited by jags1984; 04-18-2013 at 01:18 PM.
 
Old 04-18-2013, 01:28 PM   #10
jags1984
Member
 
Registered: Mar 2013
Posts: 42

Original Poster
Rep: Reputation: Disabled
Or probably python script is the better solution, if I am starting and stopping individual services frm a single linux box, but setting up these manager user id and passwd is a task.

Thankyou,

If you any other solution pls let me knw.
 
  


Reply


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
how to start/stop tomcat automatically when boots up? sujithspillai90 Linux - Newbie 4 07-24-2012 06:23 AM
[SOLVED] unable to stop start tomcat fachhoch@gmail.com Linux - Newbie 0 05-16-2012 04:08 AM
How do I get Tomcat to accept my application and start displaying the pages driven13 Linux - Server 2 05-12-2007 03:57 PM
HT Stop/Start Individual Print Queues kernelclink Linux - Newbie 1 04-29-2002 02:25 PM


All times are GMT -5. The time now is 12:00 AM.

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