Alb*_*ing 2 ruby-on-rails nginx aws-opsworks
在 Serval 天测试如何在 AWS EC2 上部署我的 ROR 项目之后。橡胶,eb,最后我决定使用 OPSWORKS,因为youtube 上的一个视频。但是部署还是很吃力的。
我知道
但下面所有的都是关于部署的日志,很少有关于访问网站的日志/信息。例如:( test.access.log )
133.255.255.124 - - [25/Jun/2014:15:10:03 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.76.4 (KHTML, like Gecko) Version/7.0.4 Safari/537.76.4"
133.255.255.124 - - [25/Jun/2014:15:10:19 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.76.4 (KHTML, like Gecko) Version/7.0.4 Safari/537.76.4"
Run Code Online (Sandbox Code Playgroud)
当我得到 500 时,我在哪里可以找到有关此信息的详细信息?这是nginx中的error.log
1. 2014/06/25 13:35:59 [emerg] 5502#0: still could not bind()
2. 2014/06/25 15:23:06 [crit] 11593#0: *2 connect() to
unix:/srv/www/test/shared/sockets/unicorn.sock failed (2: No such
file or directory) while connecting to upstream, client:
133.255.255.124, server: test, request: "GET / HTTP/1.1", upstream: "http://unix:/srv/www/test/shared/sockets/unicorn.sock:/", host:
"55.218.118.37"
Run Code Online (Sandbox Code Playgroud)
你可以发现在 500 返回期间,error.log 信息是无用的,而access.log没有什么可显示的。
这是unicorn.stderr.log中的东西,而production.log unicorn.stdout.log没有什么可显示的。即使我config.log_level = :debug在production.rb中设置并重新启动Web服务器。
I, [2014-06-25T23:45:18.172877 #6436] INFO -- : executing ["/home/deploy/.bundler/test/ruby/2.0.0/bin/unicorn_rails", "--env", "production", "--daemonize", "-c", "/srv/www/test/shared/config/unicorn.conf", {10=>#<Kgio::UNIXServer:fd 10>}] (in /srv/www/test/releases/20140625234506)
I, [2014-06-25T23:45:19.196006 #6436] INFO -- : inherited addr=/srv/www/test/shared/sockets/unicorn.sock fd=10
I, [2014-06-25T23:45:19.196505 #6436] INFO -- : Refreshing Gem list
I, [2014-06-25T23:45:23.769647 #6449] INFO -- : worker=0 ready
I, [2014-06-25T23:45:23.811102 #6436] INFO -- : master process ready
I, [2014-06-25T23:45:23.848092 #6452] INFO -- : worker=1 ready
I, [2014-06-25T23:45:24.129596 #5830] INFO -- : reaped #<Process::Status: pid 5852 exit 0> worker=0
I, [2014-06-25T23:45:24.129878 #5830] INFO -- : reaped #<Process::Status: pid 5855 exit 0> worker=1
I, [2014-06-25T23:45:24.129967 #5830] INFO -- : master complete
Run Code Online (Sandbox Code Playgroud)
登录后,您需要执行以下操作:
sudo su deploy
cd /srv/www/#{application_name}/shared/log/
Run Code Online (Sandbox Code Playgroud)
文件存储在:
/srv/www/#{application_name}/shared/log
? log ls -lsh *.log
32K -rw-r--r-- 1 deploy www-data 32K Jun 25 20:45 cron-error.log
4.0K -rw-r--r-- 1 deploy www-data 1.6K Jun 25 20:30 cron.log
192K -rw-r--r-- 1 deploy www-data 188K Jun 25 20:45 newrelic_agent.log
48M -rw-r--r-- 1 deploy www-data 47M Jun 25 20:55 staging.log
0 -rw-r--r-- 1 deploy www-data 0 Jun 24 06:46 unicorn.stderr.log
4.0K -rw-r--r-- 1 deploy www-data 3.1K Jun 25 08:49 unicorn.stdout.log
Run Code Online (Sandbox Code Playgroud)
注意:#{application_name} 是应用程序的任何短代码。
| 归档时间: |
|
| 查看次数: |
1980 次 |
| 最近记录: |