cd nginx-source
./configure --prefix=/home/ch/nginx --with-http_ssl_module --with-http_sub_module
make install
/etc/puppet/rack/config.ru
ch@squigley:/etc/puppet/rack % cat config.ru
# a config.ru, for use with every rack-compatible webserver.# SSL needs to be handled outside this, though.# if puppet is not in your RUBYLIB:$:.push('/home/ch/puppet/lib')
$0="puppetmasterd"#require 'puppet'# if you want debugging:ARGV<<"--debug"ARGV<<"--rack"require'puppet/application/puppetmasterd'# we're usually running inside a Rack::Builder.new {} block,# therefore we need to call run *here*.
run Rack::Lint.new(Puppet::Application[:puppetmasterd].run)
worker_processes 1
working_directory "/etc/puppet/rack"
listen '/tmp/my_app.sock', :backlog => 10
timeout 10
pid "/tmp/my_app.pid" # combine REE with "preload_app true" for memory savings # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
preload_app trueGC.respond_to?(:copy_on_write_friendly=) andGC.copy_on_write_friendly =true
before_fork do |server, worker|
# the following allows a new master process to incrementally # phase out the old master process with SIGTTOU to avoid a # thundering herd (especially in the "preload_app false" case) # when doing a transparent upgrade. The last worker spawned # will then kill off the old master process with a SIGQUIT.
old_pid ="#{server.config[:pid]}.oldbin"if old_pid != server.pid
begin
sig = (worker.nr +1) >= server.worker_processes ?:QUIT : :TTOUProcess.kill(sig, File.read(old_pid).to_i)
rescueErrno::ENOENT, Errno::ESRCHendend # optionally throttle the master from forking too quickly by sleeping
sleep 1end
after_fork do |server, worker|
uid, gid =Process.euid, Process.egid
user, group ='puppet', 'puppet'
target_uid =Etc.getpwnam(user).uid
target_gid =Etc.getgrnam(group).gid
worker.tmp.chown(target_uid, target_gid)
if uid != target_uid || gid != target_gid
Process.initgroups(user, target_gid)
Process::GID.change_privilege(target_gid)
Process::UID.change_privilege(target_uid)
end # per-process listener ports for debugging/admin/migrations
addr ="127.0.0.1:#{9293+ worker.nr}"
server.listen(addr, :tries => 1, :delay => 5, :tcp_nopush => true)
sleep 3end