fabtools.require.apache

Apache

This module provides high-level tools for installing the apache2 web server and managing the configuration of web sites.

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

Require apache2 server to be installed and running.

from fabtools import require

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

Ensure link to /etc/apache2/mods-available/module exists and reload apache2 configuration if needed.

fabtools.require.apache.module_disabled(module)[source]

Ensure link to /etc/apache2/mods-available/module doesn’t exist and reload apache2 configuration if needed.

fabtools.require.apache.site_enabled(config)[source]

Ensure link to /etc/apache2/sites-available/config exists and reload apache2 configuration if needed.

fabtools.require.apache.site_disabled(config)[source]

Ensure link to /etc/apache2/sites-available/config doesn’t exist and reload apache2 configuration if needed.

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

Require an apache2 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',
)
fabtools.require.apache.enabled(config)

Ensure link to /etc/apache2/sites-available/config exists and reload apache2 configuration if needed.

fabtools.require.apache.disabled(config)

Ensure link to /etc/apache2/sites-available/config doesn’t exist and reload apache2 configuration if needed.

Read the Docs v: 0.17.0
Versions
latest
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.