The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Rex::Apache::Deploy::Tomcat7 - Deploy application to Tomcat 7.

DESCRIPTION

With this module you can deploy WAR archives to Tomcat7. This module needs the manager application and manager-script permissions.

SYNOPSIS

use Rex::Apache::Deploy qw/Tomcat7/;

context_path "/myapp";

task "dodeploy", "tc01", "tc02", sub {
  deploy "myapp.war",
    username => "manager",
    password => "manager",
    port    => 8080;
};

FUNCTIONS

deploy($file, %option)

This function deploys the given WAR archive. For that it will connect to the Tomcat manager. You have to define username and password for the Tomcat manager in the %option hash. If the Tomcat manager isn't available under its default location /manager you can also define the location with the manager_url option.

task "dodeploy", "tc01", "tc02", sub {
  deploy "myapp.war",
    username    => "manager",
    password    => "manager",
    manager_url  => "_manager",
    port      => 8080,
    context_path => "/foo";
};
context_path($path)

This function sets the context path for the application that gets deployed. This is a global setting. If you want to specify a custom context path for your application you can also do this as an option for the deploy function.

context_path "/myapp";