提交 b49de6b7 编写于 作者: J Jamis Buck

Copy lighttpd.conf when it is first needed, instead of on app creation


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 aec5273f
*SVN*
* Copy lighttpd.conf when it is first needed, instead of on app creation [Jamis Buck]
* Use require_library_or_gem 'fcgi' in script/server [Sam Stephenson]
* Added default lighttpd config in config/lighttpd.conf and added a default runner for lighttpd in script/server (works like script/server, but using lighttpd and FastCGI). It will use lighttpd if available, otherwise WEBrick. You can force either or using 'script/server lighttpd' or 'script/server webrick' [DHH]
......
# Default configuration file for the lighttpd web server
# Start using ./script/lighttpd
# Start using ./script/server lighttpd
server.port = 3000
......
......@@ -21,6 +21,14 @@ def tail_f(input)
config_file = "#{RAILS_ROOT}/config/lighttpd.conf"
unless File.exist?(config_file)
require 'fileutils'
source = File.expand_path(File.join(File.dirname(__FILE__),
"..", "..", "..", "configs", "lighttpd.conf"))
puts "=> #{config_file} not found, copying from #{source}"
FileUtils.cp source, config_file
end
port = IO.read(config_file).scan(/^server.port\s*=\s*(\d+)/).first rescue 3000
puts "=> Rails application started on http://0.0.0.0:#{port}"
......
......@@ -39,7 +39,6 @@ def manifest
}
m.template "configs/routes.rb", "config/routes.rb"
m.template "configs/apache.conf", "public/.htaccess"
m.template "configs/lighttpd.conf", "config/lighttpd.conf"
# Environments
m.file "environments/boot.rb", "config/boot.rb"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册