'Enables module in Apache.
Both enables and reloads Apache so module is active.
:param str mod_name: Name of the module to enable. (e.g. \'ssl\')
:param bool temp: Whether or not this is a temporary action.
:raises .errors.NotSupportedError: If the filesystem layout is not
supported.
:raises .errors.MisconfigurationError: If a2enmod or a2dismod cannot be
run.'

def enable_mod(self, mod_name, temp=False):

    avail_path = os.path.join(self.parser.root, 'mods-available')
    enabled_path = os.path.join(self.parser.root, 'mods-enabled')
    if ((not os.path.isdir(avail_path)) or (not os.path.isdir(enabled_path))):
        raise errors.NotSupportedError(('Unsupported    directory    layout.    You    may    try    to    enable    mod    %s    and    try    again.' % mod_name))
    deps = _get_mod_deps(mod_name)
    for dep in deps:
        if ((dep + '_module') not in self.parser.modules):
            self._enable_mod_debian(dep, temp)
            self._add_parser_mod(dep)
            note = ('Enabled    dependency    of    %s    module    -    %s' % (mod_name, dep))
            if (not temp):
                self.save_notes += (note + os.linesep)
            logger.debug(note)
    self._enable_mod_debian(mod_name, temp)
    self._add_parser_mod(mod_name)
    if (not temp):
        self.save_notes += ('Enabled    %s    module    in    Apache\n' % mod_name)
    logger.info('Enabled    Apache    %s    module', mod_name)
    self.parser.update_runtime_variables()
