Skip to content

Commit

Permalink
Copy lighttpd.conf when it is first needed, instead of on app creation
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Nov 7, 2005
1 parent aec5273 commit b49de6b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion railties/configs/lighttpd.conf
@@ -1,5 +1,5 @@
# Default configuration file for the lighttpd web server
# Start using ./script/lighttpd
# Start using ./script/server lighttpd

server.port = 3000

Expand Down
8 changes: 8 additions & 0 deletions railties/lib/commands/servers/lighttpd.rb
Expand Up @@ -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}"

Expand Down
Expand Up @@ -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"
Expand Down

0 comments on commit b49de6b

Please sign in to comment.