mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
aec5273f41
commit
b49de6b74b
4 changed files with 11 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
*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]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Default configuration file for the lighttpd web server
|
||||
# Start using ./script/lighttpd
|
||||
# Start using ./script/server lighttpd
|
||||
|
||||
server.port = 3000
|
||||
|
||||
|
|
|
@ -21,6 +21,14 @@ end
|
|||
|
||||
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 @@ class AppGenerator < Rails::Generator::Base
|
|||
}
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue