fabtools.apache

Apache

This module provides tools for configuring the Apache HTTP Server.

fabtools.apache.is_module_enabled(module)[source]

Check if an Apache module is enabled.

fabtools.apache.enable_module(module)[source]

Enable an Apache module.

This creates a symbolic link from /etc/apache2/mods-available/ into /etc/apache2/mods-enabled/.

This does not cause Apache to reload its configuration.

import fabtools

fabtools.apache.enable_module('rewrite')
fabtools.service.reload('apache2')
fabtools.apache.disable_module(module)[source]

Disable an Apache module.

This deletes the symbolink link in /etc/apache2/mods-enabled/.

This does not cause Apache to reload its configuration.

import fabtools

fabtools.apache.disable_module('rewrite')
fabtools.service.reload('apache2')
fabtools.apache.is_site_enabled(config)[source]

Check if an Apache site is enabled.

fabtools.apache.enable_site(config)[source]

Enable an Apache site.

This creates a symbolic link from /etc/apache2/sites-available/ into /etc/apache2/sites-enabled/.

This does not cause Apache to reload its configuration.

import fabtools

fabtools.apache.enable_site('default')
fabtools.service.reload('apache2')
fabtools.apache.disable_site(config)[source]

Disable an Apache site.

This deletes the symbolink link in /etc/apache2/sites-enabled/.

This does not cause Apache to reload its configuration.

import fabtools

fabtools.apache.disable_site('default')
fabtools.service.reload('apache2')