diff --git a/railties/CHANGELOG b/railties/CHANGELOG index f6dfa85fb3b6d6bb33f2c10e664b2b15cc54c458..9cf4f6c10c80dc8b043bcef93f53da60bee30619 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Have the lighttpd server script report the actual ip to which the server is bound. #2903. [Adam] + * Add plugin library directories to the load path after the lib directory so that libraries in the lib directory get precedence. #2910. [james.adam@gmail.com] * Make help for the console command more explicit about how to specify the desired environment in which to run the console. #2911. [anonymous] diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb index a35bc984c7873445e63359dd2bee5efd3b54bcbf..16baf1e367591dcf9b612ee1f8a638a1feed826e 100644 --- a/railties/lib/commands/servers/lighttpd.rb +++ b/railties/lib/commands/servers/lighttpd.rb @@ -19,8 +19,11 @@ 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}" +config = IO.read(config_file) +default_port, default_ip = 3000, '0.0.0.0' +port = config.scan(/^server.port\s*=\s*(\d+)/).first rescue default_port +ip = config.scan(/^server.bind\s*=\s*"([^"]+)"/).first rescue default_ip +puts "=> Rails application started on http://#{ip || default_ip}:#{port || default_port}" tail_thread = nil @@ -53,4 +56,4 @@ trap(:INT) { exit } `lighttpd #{!detach ? "-D " : ""}-f #{config_file}` -tail_thread.kill if tail_thread \ No newline at end of file +tail_thread.kill if tail_thread