Class: Apache::MPM::Prefork

Inherits:
Object
  • Object
show all
Defined in:
lib/apache/mpm_prefork.rb

Overview

Builder for Prefork MPM See Apache::MPM::prefork_config for usage.

Class Method Summary collapse

Class Method Details

.build(&block) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/apache/mpm_prefork.rb', line 30

def build(&block)
  @config = ['', '# Prefork config', '']

  self.instance_eval(&block)

  @config
end

.method_missing(method, *opts) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/apache/mpm_prefork.rb', line 38

def method_missing(method, *opts)
  if which = {
    :start => 'StartServers',
    :spares => [ 'MinSpareServers', 'MaxSpareServers' ],
    :limit => 'ServerLimit',
    :clients => 'MaxClients',
    :max_requests => 'MaxRequestsPerChild'
  }[method]
    case which
      when String
        @config << "#{which} #{opts * " "}"
      when Array
        which.each do |tag|
          @config << "#{tag} #{opts.shift}"
        end
    end
  end
end