Sha256: 8505986ca2c26dec405b4b2652ed95535a7846414028adf9eb01d776e90206ec

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

---
title: About the apache Resource
platform: linux
---

# apache

Use the `apache` InSpec audit resource to test the state of the Apache server on Linux/Unix systems.

<p class="warning">This resource is deprecated and should not be used. It will be removed in InSpec 3.0.</p>

<br>

## Syntax

An `apache` InSpec audit resource block declares settings that should be tested:

    describe apache do
      its('setting_name') { should cmp 'value' }
    end

where

* `'setting_name'` is description of the Apache configuration file
* `{ should cmp 'value' }` is the value that is expected

<br>

## Properties

* 'service', 'conf_dir', 'conf_path', 'user'

<br>

## Property Examples

The following examples show how to use this InSpec audit resource.

### Test the service name.

    describe apache do
      its ('service') { should cmp 'apache2' }
    end

### Test the configuration location

    describe apache do
      its ('conf_dir') { should cmp '/etc/apache2' }
    end

### Test the path of the configuration file

    describe apache do
      its ('conf_path') { should cmp '/etc/apache2/apache2.conf' }
    end

### Test the apache user

    describe apache do
      its ('user') { should cmp 'www-data' }
    end

<br>

## Matchers

For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 docs/resources/apache.md.erb
inspec-2.1.21 docs/resources/apache.md.erb
inspec-2.1.10 docs/resources/apache.md.erb
inspec-2.0.32 docs/resources/apache.md.erb
inspec-2.0.17 docs/resources/apache.md.erb