1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Changed default lighttpd.conf to use CWD from lighttpd 1.4.10 that allows the same configuration to be used for both detach and not. Also ensured that auto-repeaping of FCGIs only happens when lighttpd is not detached. [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2006-02-12 17:41:53 +00:00
parent db2023d4d2
commit b230004897
3 changed files with 15 additions and 11 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Changed default lighttpd.conf to use CWD from lighttpd 1.4.10 that allows the same configuration to be used for both detach and not. Also ensured that auto-repeaping of FCGIs only happens when lighttpd is not detached. [DHH]
* Added Configuration#after_initialize for registering a block which gets called after the framework is fully initialized. Useful for things like per-environment configuration of plugins. [Michael Koziarski]
* Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails framework to be found in a different place than vendor/rails. Should be set in boot.rb. [DHH]

View file

@ -7,8 +7,8 @@ server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "public/"
server.errorlog = "log/lighttpd.error.log"
accesslog.filename = "log/lighttpd.access.log"
server.errorlog = CWD + "/log/lighttpd.error.log"
accesslog.filename = CWD + "/log/lighttpd.access.log"
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
@ -19,8 +19,8 @@ fastcgi.server = ( ".fcgi" =>
(
"min-procs" => 1,
"max-procs" => 1,
"socket" => "log/fcgi.socket",
"bin-path" => "public/dispatch.fcgi",
"socket" => CWD + "/log/fcgi.socket",
"bin-path" => CWD + "/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" )
)
)

View file

@ -32,10 +32,10 @@ puts "=> Rails application started on http://#{ip || default_ip}:#{port || defau
tail_thread = nil
if ARGV.first == "-d"
puts "=> Configure in config/lighttpd.conf"
puts "=> Configuration in config/lighttpd.conf"
detach = true
else
puts "=> Call with -d to detach (requires absolute paths in config/lighttpd.conf)"
puts "=> Call with -d to detach"
puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)"
detach = false
@ -62,10 +62,12 @@ trap(:INT) { exit }
begin
`lighttpd #{!detach ? "-D " : ""}-f #{config_file}`
ensure
tail_thread.kill if tail_thread
puts 'Exiting'
unless detach
tail_thread.kill if tail_thread
puts 'Exiting'
# Ensure FCGI processes are reaped
path_to_ruby = "#{Config::CONFIG['bindir']}/#{Config::CONFIG['ruby_install_name']}"
`#{path_to_ruby} #{RAILS_ROOT}/script/process/reaper -a kill`
# Ensure FCGI processes are reaped
path_to_ruby = "#{Config::CONFIG['bindir']}/#{Config::CONFIG['ruby_install_name']}"
`#{path_to_ruby} #{RAILS_ROOT}/script/process/reaper -a kill`
end
end