6.7 Adding, Editing, or Removing Apache Blocks

Apache blocks are directives used to enclose a set of configurations. For example, the Directory directive is used to enclose a group of directives that apply only to a directory (and its sub-directories) specified within the enclosure. For example:

<Directory sys:\apache2\htdocs>
       Options Indexes FollowSymLinks
</Directory>

In this example, the directives included between the Directory tags (comparable to standard HTML tag syntax) are all applied as part of the Apache block.

A block can be defined at any level in the object's hierarchy so that one or more server configurations can inherit it. This allows the block definition to be applied in exactly the same way by multiple Web servers without redefining the block for each server. A block cannot contain any other objects.

Before adding a block, you might want to look at the documentation for its directives in the Directive Quick Reference on the Apache.org Web site.

To add a new block:

  1. From the Objects list, click a server group, server name, or virtual host object where you want to add the block object.

  2. In the Choose Action drop-down list, select Add Block, then click Zigzag icon.

  3. In the Add Block dialog box, type a name for the block object in the Common Name field.

  4. In the Scope field, type the file path used in the block's open statement.

    Scope refers to the file path specified in the open statement of a block. For example, if the block type is Directory, the block's open statement might be:

    <Directory sys:\apache2\htdocs>
    

    In this case, you would type sys:\apache2\htdocs in the Scope field.

  5. Click the Block Type drop-down list and select the type of block being defined.

    Because each block type is an actual directive, you can look up the directive in the Apache documentation for more information about each block type. See the Directive Quick Reference on the Apache.org Web site.

  6. Click OK.

To edit a block:

  1. In the Objects list, click a server group, server name, module, or virtual host object that contains the block you want to edit.

  2. Click the block that you want to edit, select Edit Object from the Choose Action drop-down list, then click Zigzag icon.

  3. In the Edit Block dialog box, make the necessary changes.

  4. Click OK.

To remove a block:

  1. In the Objects list, click a server group, server name, module, or virtual host object that contains the block you want to remove.

  2. Click the block that you want removed, select Remove Object from the Choose Actions drop-down list, then click Zigzag icon.

    IMPORTANT:After you remove a block, there is no way to retrieve it. You must create it again.

  3. Click OK.