2

I am trying to stop a webapp running on Tomcat 7 from a windows cmd prompt. I am a linux user but not choice I have to use the Windows OS for this. I installed wget on windows and plan on using that to send to stop command to a webapp.

My tomcat-users.xml looks like this (only one user setup in here):

<user name="admin" password="password" roles="admin-gui,manager-gui,manager-script" />

Have tried this also:

<user name="admin" password="password" roles="manager-script" />

Here are the different commands I send:

wget http://admin:password@tomcatserver:8080/manager/html/stop?path=/webapp

wget "http://admin:password@tomcat:8080/manager/html/stop?path=/webapp" -O - -q

I keep getting this output (removed the 'p' in http below cause overstack wouldn't let me post otherwise):

SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2015-01-13 15:43:06--  htt://admin:*password*@tomcat:8080/manager/html/stop?path=/webapp
Resolving tomcat... 10.0.0.5, fc80::aee9:246b:46ce:5190
Connecting to tomcat|10.0.0.5|:8080... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to tomcat|10.0.0.5|:8080... connected.
HTTP request sent, awaiting response... 403 Forbidden
2015-01-13 15:43:06 ERROR 403: Forbidden.

1 Answers1

0

I believe wget doesn't understand that you're attempting to authenticate within the url. You may try providing the username and password like so:

wget --user=remote_user --password=SECRET http://tomcat:8080/manager/html/stop?path=/webapp

Also, you may try "Invoke-WebRequest" via powershell as described here

Curtis
  • 548
  • 3
  • 13