system-config/modules/etherpad_lite/manifests/apache.pp
Clark Boylan 873cb03aef Tune apache for etherpad lite.
* modules/etherpad_lite/manifests/apache.pp: Install apache etherpad
lite connection tuning config file.

* modules/etherpad_lite/files/apache-connection-tuning: Configure the
Apache MPM Worker module to run up to 64 processes with 32 threads each
for a grand total of 2048 client connections maximum. This should be
relatively safe as etherpad connections are not very heavy. Most
connections come from users that lurk, they don't provide any input
that creates writes to the database. For example at a design summit we
may have 8 design room seach with an etherpad open, in each room there
may be 20 people connected to the etherpad but only 2-4 writing to it.

Change-Id: I3f406af1204b993d2b083180f17cafcf4f62f5bc
2013-10-09 16:53:27 -07:00

86 lines
2.0 KiB
Puppet

# == Class: etherpad_lite::apache
#
class etherpad_lite::apache (
$vhost_name = $::fqdn,
$ssl_cert_file = '',
$ssl_key_file = '',
$ssl_chain_file = '',
$ssl_cert_file_contents = '', # If left empty puppet will not create file.
$ssl_key_file_contents = '', # If left empty puppet will not create file.
$ssl_chain_file_contents = '' # If left empty puppet will not create file.
) {
package { 'ssl-cert':
ensure => present,
}
include apache
apache::vhost { $vhost_name:
port => 443,
docroot => 'MEANINGLESS ARGUMENT',
priority => '50',
template => 'etherpad_lite/etherpadlite.vhost.erb',
ssl => true,
}
a2mod { 'rewrite':
ensure => present,
}
a2mod { 'proxy':
ensure => present,
}
a2mod { 'proxy_http':
ensure => present,
}
file { '/etc/apache2/conf.d/connection-tuning':
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/etherpad_lite/apache-connection-tuning',
notify => Service['httpd'],
}
file { '/etc/ssl/certs':
ensure => directory,
owner => 'root',
mode => '0755',
}
file { '/etc/ssl/private':
ensure => directory,
owner => 'root',
mode => '0700',
}
if $ssl_cert_file_contents != '' {
file { $ssl_cert_file:
owner => 'root',
group => 'root',
mode => '0640',
content => $ssl_cert_file_contents,
before => Apache::Vhost[$vhost_name],
}
}
if $ssl_key_file_contents != '' {
file { $ssl_key_file:
owner => 'root',
group => 'ssl-cert',
mode => '0640',
content => $ssl_key_file_contents,
require => Package['ssl-cert'],
before => Apache::Vhost[$vhost_name],
}
}
if $ssl_chain_file_contents != '' {
file { $ssl_chain_file:
owner => 'root',
group => 'root',
mode => '0640',
content => $ssl_chain_file_contents,
before => Apache::Vhost[$vhost_name],
}
}
}