NAME

Test::Instance::Apache::Modules - Apache module management for T::I::A

SYNOPSIS

  use FindBin qw/ $Bin /;
  use Test::Instance::Apache::Modules;

  my $modules = Test::Instance::Apache::Modules->new(
    server_root => "$Bin/conf",
    modules => [ qw/ mpm_prefork authz_core mome / ],
  );

  # get include paths for config
  my $paths = $modules->include_modules;

DESCRIPTION

Test::Instance::Apache::Modules sets up the required modules for Apache according to an array of module names. This functions similarly to a2enmod which comes as part of the Apache distribution, however is much more simplified to only do what is necessary for T::I::A.

The module creates a mods-available and mods-enabled folder inside the "server_root" directory, and then copies the contents of /etc/apache2/mods-available into the new mods-available folder. Then, symlinks are created across to the mods-enabled folder, ready for Apache to include from the "include_modules" list.

Attributes

These are the available attributes on Test::Instance::Apache::Modules

modules

The arrayref of modules to symlink into mods-enabled folder. This is required. Note that any modules specified here will need to be installed on your local machine, and you will have to specify ALL modules required - there are no assumptions made for modules to include.

server_root

The root directory of the server config. This directory is where mods-available and mods-enabled directories will be created. This attribute is required.

include_modules

This creates the include paths for the conf and load files as required by Apache.

Methods

These are the methods available on Test::Instance::Apache::Modules.

load_modules

This function performs the main part of this module. This copies all the current mods from /etc/apache2/mods-available to the mods-available directory, and then symlinks all the required modules across to the mods-enabled folder.

make_server_dir

Utility function to create a new directory in the "server_root".

AUTHOR

Tom Bloor <t.bloor@shadowcat.co.uk>

COPYRIGHT

Copyright 2016 Tom Bloor

LICENCE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO