提交 2b6e2bfe 编写于 作者: S Sam Stephenson

Have the lighttpd server script report the actual ip to which the server is bound. Closes #2903.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3123 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 9a37fd44
*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]
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册