• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

request.host などがちゃんとリモートホストのドメイン名を指すように、 以下のように設定します。

   1  location / {
   2    # ..snip..
   3  
   4    proxy_redirect     off;
   5    proxy_set_header   Host             $host;
   6    proxy_set_header   X-Real-IP        $remote_addr;
   7    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
   8  
   9    # ..snip..
  10  }

ちょっと設定を忘れていてRSS中のGUIDがlocalhsotを指すという問題が発生しておりました。現在は復旧しております。 ご不便をおかけいたしましたことをお詫びいたします。

posted by Png genki on Wed 25 May 2011 at 23:13

またプロセスがハングアップする問題が発生したため、システム構成を見直し。 passengerからunicornに切り替えました。 正確な構成は、

  • rails-2.3.11
  • rack-1.1.2
  • unicorn-3.6.2
  • nginx-1.0.0

という感じです。

unicornのマスタープロセスのPIDを取得するために、以下のようなスクリプトを使ってます。

unicorn_master.rb

   1  port = ARGV.shift
   2  pids = `lsof -i:#{port} | awk "{print \\$2}"`.split("\n")[1..-1]
   3  pids.each do |pid|
   4    puts pid if `ps --ppid #{pid}`.split("\n").size > 1
   5  end
   6  
   7  # USAGE:
   8  #   ruby unicorn_master.rb <#port>

またしばらく様子をみてみます。

posted by Png genki on Wed 25 May 2011 at 13:05

rackupしようとすると、1.3.0と1.1.0でコンフリクトして無理、というお馴染みのメッセージが出ていて困ったのですが、bundlerを使っている場合、

   1  % bundle exec rackup

すればOKなようだ。

posted by Png genki on Wed 25 May 2011 at 09:23

古いRailsアプリをBundler仕様にする場合、

   1  config.gem "foo",
   2    :version => "0.0.1",
   3    :lib => "bar",
   4    :source => "http://gems.github.com"

と等価なGemfileの記述方法は

   1  source "http://gems.github.com"
   2  gem "foo", "0.0.1", :require => "bar"

で良いようです。バージョン指定をしない場合は第二引数を省略可。

posted by Png genki on Wed 25 May 2011 at 08:10
Contents
nginx -> unicorn 時のプロクシの設定メモ
blogのシステム構成を更新しました
bundlerでrackupする方法のメモ
bundlerで:lib, :sourceを指定する場合のメモ
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
瀧内元気: おお、チェックしてみます。thx! '11-12
overisland: Reeder for iPhone もこの UI を実装していますね。 '11-12
瀧内元気: その情報は見たのですが、以下のサイトによると、現在はまた必要になってるっぽいんですよね。 ... '11-12
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ