2018-01-31 05:16:15 -05:00
---
title: About the apache Resource
2018-02-15 18:28:15 -06:00
platform: linux
2018-01-31 05:16:15 -05:00
---
# apache
2019-06-03 11:56:34 -04:00
**Warning**:This resource is deprecated and should not be used. It was removed in Chef InSpec 4.0. The documentation below is preserved as a reference. Replacement functionality is available in the [`apache_conf`](/docs/reference/resources/apache_conf) resource.
2018-01-31 05:16:15 -05:00
2019-05-30 11:37:47 -04:00
Use the `apache` Chef InSpec audit resource to test the state of the Apache server on Linux/Unix systems.
2018-01-31 05:16:15 -05:00
<br>
2018-08-09 08:34:49 -04:00
## Availability
### Installation
2019-05-30 11:37:47 -04:00
This resource was distributed along with Chef InSpec itself.
2018-08-09 08:34:49 -04:00
### Version
2019-05-30 11:37:47 -04:00
This resource first became available in v1.51.15 of InSpec and was removed in version 4.0.
2018-08-09 08:34:49 -04:00
2018-01-31 05:16:15 -05:00
## Syntax
2019-04-26 14:24:29 -04:00
An `apache` Chef InSpec audit resource block declares settings that should be tested:
2018-01-31 05:16:15 -05:00
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>
2018-02-15 06:33:22 -08:00
## Properties
2018-01-31 05:16:15 -05:00
2018-06-06 11:10:48 -07:00
* `service`, `conf_dir`, `conf_path`, `user`
2018-01-31 05:16:15 -05:00
<br>
## Property Examples
2019-04-26 14:24:29 -04:00
The following examples show how to use this Chef InSpec audit resource.
2018-01-31 05:16:15 -05:00
### 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
2018-02-15 19:07:18 -08:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).