Tomcat has its own Java tool to deploy and undeploy applications, but I am not happy with its speed at all. The following is my Perl script I used to replace Java. Very fast!
Next step, I will
use IO::Socket; use MIME::Base64; use strict; use warnings; my $credentials = encode_base64("peip:930612"); my $conn = new IO::Socket::INET(Proto => "tcp", PeerAddr => "localhost +", PeerPort => 8080) || die "dead"; my $req; if ($ARGV[0] eq "remove") { $req = "GET http://localhost:8080/manager/remove?path=/hello1 HTTP +/1.1\r\n"; $req .= "Authorization: Basic " . $credentials . "\r\n"; $req .= "Host: localhost:8080\r\n\r\n"; } elsif ($ARGV[0] eq "install") { $req = "GET http://localhost:8080/manager/install?path=/hello1&war +=jar:file:/jwsdp/webapps/jwstutorial13/examples/web/hello1/dist/hello +1.war!/ HTTP/1.1\r\n"; $req .= "Authorization: Basic " . $credentials . "\r\n"; $req .= "Host: localhost:8080\r\n\r\n"; } print $conn $req; while (my $line = <$conn>) { print $line; } close($conn);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl helps Tomcat
by hossman (Prior) on Dec 18, 2003 at 07:51 UTC |