Skip to content

Commit

Permalink
Add basic mpm_event docs, fix formatting, appease older ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
stumped2 committed Nov 19, 2014
1 parent 5ac2f34 commit 468647c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [Class: apache::default_mods](#class-apachedefault_mods)
* [Defined Type: apache::mod](#defined-type-apachemod)
* [Classes: apache::mod::*](#classes-apachemodname)
* [Class: apache::mod::event](#class-apachemodevent)
* [Class: apache::mod::info](#class-apachemodinfo)
* [Class: apache::mod::pagespeed](#class-apachemodpagespeed)
* [Class: apache::mod::php](#class-apachemodphp)
Expand Down Expand Up @@ -525,7 +526,7 @@ There are many `apache::mod::[name]` classes within this module that can be decl
* `dev`
* `dir`*
* `disk_cache`
* `event`
* `event`(see [`apache::mod::event`](#class-apachemodevent) below)
* `expires`
* `fastcgi`
* `fcgid`
Expand Down Expand Up @@ -569,11 +570,26 @@ Modules noted with a * indicate that the module has settings and, thus, a templa

The modules mentioned above, and other Apache modules that have templates, cause template files to be dropped along with the mod install. The module will not work without the template. Any module without a template installs the package but drops no files.

####Class: `apache::mod::event

Installs and manages mpm_event module.

Full Documentation for mpm_event is available from [Apache](https://httpd.apache.org/docs/current/mod/event.html).

To configure the event thread limit:

```puppet
class {'apache::mod::event':
$threadlimit => '128',
}
```


####Class: `apache::mod::info`

Installs and manages mod_info which provides a comprehensive overview of the server configuration.

Full documentation for mod_info is available from [Apache](http://httpd.apache.org/docs/2.2/mod/mod_info.html).
Full documentation for mod_info is available from [Apache](https://httpd.apache.org/docs/current/mod/mod_info.html).

These are the default settings:

Expand Down
24 changes: 11 additions & 13 deletions spec/classes/mod/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@
}
end

it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file')
.with_content(/^\s*ServerLimit\s*0/)
.with_content(/^\s*StartServers\s*1/)
.with_content(/^\s*MaxClients\s*2/)
.with_content(/^\s*MinSpareThreads\s*3/)
.with_content(/^\s*MaxSpareThreads\s*4/)
.with_content(/^\s*ThreadsPerChild\s*5/)
.with_content(/^\s*MaxRequestsPerChild\s*6/)
.with_content(/^\s*ThreadLimit\s*7/)
.with_content(/^\s*ListenBacklog\s*8/)
.with_content(/^\s*MaxRequestWorkers\s*9/)
.with_content(/^\s*MaxConnectionsPerChild\s*10/)
}
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ServerLimit\s*0/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*StartServers\s*1/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxClients\s*2/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MinSpareThreads\s*3/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxSpareThreads\s*4/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ThreadsPerChild\s*5/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxRequestsPerChild\s*6/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ThreadLimit\s*7/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ListenBacklog\s*8/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxRequestWorkers\s*9/) }
it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxConnectionsPerChild\s*10/) }
end

context "with Apache version < 2.4" do
Expand Down
20 changes: 10 additions & 10 deletions templates/mod/event.conf.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<IfModule mpm_event_module>
ServerLimit <%= @serverlimit %>
StartServers <%= @startservers %>
MaxClients <%= @maxclients %>
MinSpareThreads <%= @minsparethreads %>
MaxSpareThreads <%= @maxsparethreads %>
ThreadsPerChild <%= @threadsperchild %>
MaxRequestsPerChild <%= @maxrequestsperchild %>
ThreadLimit <%= @threadlimit %>
ListenBacklog <%= @listenbacklog %>
MaxRequestWorkers <%= @maxrequestworkers %>
ServerLimit <%= @serverlimit %>
StartServers <%= @startservers %>
MaxClients <%= @maxclients %>
MinSpareThreads <%= @minsparethreads %>
MaxSpareThreads <%= @maxsparethreads %>
ThreadsPerChild <%= @threadsperchild %>
MaxRequestsPerChild <%= @maxrequestsperchild %>
ThreadLimit <%= @threadlimit %>
ListenBacklog <%= @listenbacklog %>
MaxRequestWorkers <%= @maxrequestworkers %>
MaxConnectionsPerChild <%= @maxconnectionsperchild %>
</IfModule>

0 comments on commit 468647c

Please sign in to comment.