inspec/docs/resources/apache.md.erb
Adam Leff 689fe34cc9 apache resource: document and deprecate (#2494)
* Docs for apache resource

Signed-off-by: kgarmoe <kgarmoe@chef.io>

* Add deprecation warning to apache docs and resource, and clean up examples.

Signed-off-by: Adam Leff <adam@leff.co>

* Update apache_conf resource to remove dependency on apache resource

Signed-off-by: Adam Leff <adam@leff.co>

* Make conf_dir method public

Signed-off-by: Adam Leff <adam@leff.co>

* Removes unnecessary aide_conf commit, pulled in from e25f0a45

Signed-off-by: Adam Leff <adam@leff.co>

* Switch to Pathname to calculate conf_dir

Needed to avoid Windows adding `C:\` in unit tests when calling
File.expand_path.

Signed-off-by: Adam Leff <adam@leff.co>
2018-01-31 11:16:15 +01:00

66 lines
1.3 KiB
Text

---
title: About the apache Resource
---
# 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>
## Supported 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/).