Test::Instance::Apache::Modules - Apache module management for T::I::A
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;
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.
a2enmod
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.
mods-available
mods-enabled
/etc/apache2/mods-available
These are the available attributes on Test::Instance::Apache::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.
The root directory of the server config. This directory is where mods-available and mods-enabled directories will be created. This attribute is required.
This creates the include paths for the conf and load files as required by Apache.
conf
load
These are the methods available on Test::Instance::Apache::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.
Utility function to create a new directory in the "server_root".
Tom Bloor <t.bloor@shadowcat.co.uk>
Copyright 2016 Tom Bloor
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Test::Instance::Apache
To install Test::Instance::Apache, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Instance::Apache
CPAN shell
perl -MCPAN -e shell install Test::Instance::Apache
For more information on module installation, please visit the detailed CPAN module installation guide.