LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to start and stop the tomcat individual application in linux ?? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-start-and-stop-the-tomcat-individual-application-in-linux-4175458305/)

jags1984 04-16-2013 07:11 AM

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

j-ray 04-17-2013 02:27 AM

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

jags1984 04-17-2013 03:23 AM

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

bathory 04-17-2013 03:36 AM

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

jags1984 04-17-2013 10:01 AM

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

bathory 04-17-2013 11:19 AM

Quote:

Originally Posted by jags1984 (Post 4933254)
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.

jags1984 04-18-2013 12:22 AM

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 ?

bathory 04-18-2013 02:28 AM

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

jags1984 04-18-2013 01:09 PM

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.

jags1984 04-18-2013 01:28 PM

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.


All times are GMT -5. The time now is 05:14 AM.