fabtools.require.apache

Apache

This module provides high-level tools for installing and configuring the Apache HTTP Server.

See also

fabtools.apache

fabtools.require.apache.server()[source]

Require the Apache HTTP server to be installed and running.

from fabtools import require

require.apache.server()
fabtools.require.apache.module_enabled(module)[source]

Require an Apache module to be enabled.

This will cause Apache to reload its configuration.

from fabtools import require

require.apache.module_enabled('rewrite')
fabtools.require.apache.module_disabled(module)[source]

Require an Apache module to be disabled.

This will cause Apache to reload its configuration.

from fabtools import require

require.apache.module_disabled('rewrite')
fabtools.require.apache.site_enabled(config)[source]

Require an Apache site to be enabled.

This will cause Apache to reload its configuration.

from fabtools import require

require.apache.site_enabled('mysite')
fabtools.require.apache.site_disabled(config)[source]

Require an Apache site to be disabled.

This will cause Apache to reload its configuration.

from fabtools import require

require.apache.site_disabled('default')
fabtools.require.apache.site(config_name, template_contents=None, template_source=None, enabled=True, check_config=True, **kwargs)[source]

Require an Apache site.

You must provide a template for the site configuration, either as a string (template_contents) or as the path to a local template file (template_source).

from fabtools import require

CONFIG_TPL = '''
<VirtualHost *:%(port)s>
    ServerName %(hostname})s

    DocumentRoot %(document_root)s

    <Directory %(document_root)s>
        Options Indexes FollowSymLinks MultiViews

        AllowOverride All

        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>
'''

require.apache.site(
    'example.com',
    template_contents=CONFIG_TPL,
    port=80,
    hostname='www.example.com',
    document_root='/var/www/mysite',
)