LoginSignup
4
4

More than 5 years have passed since last update.

OpsWorksでRails+SQLiteアプリを立ち上げてみるときの設定

Last updated at Posted at 2014-11-29

OpsWorksを試しに使ってみようと思い、細かいこと考えず、
RailsアプリのDBをSQLiteにして、とりあえず動かしてみたかった。

そういうわけで、こちらを参考にやってみた。
http://qiita.com/jwako/items/4890b5b2d9c26d1eb4b6

secret_key_base

Custom JSONに、secret.ymlのsecret_key_baseをJSONで指定

という部分は、OpsWorksの機能追加(?)の関係で、Appの設定の「Environment Variables」からSECRET_KEY_BASEを登録すればOKだった

Custom JSON

DB用の設定はStackの設定の「Configuration management > Custom JSON」に入れた

{
  "deploy": {
    "railbook": {
      "database": {
        "host": "localhost",
        "database": "db/railbook.sqlite3",
        "adapter": "sqlite3"
      },
      "migrate": true
    }
  }
}

その他

ログを見たいとき

# unicornのエラーログ
/srv/www/app-name/current/log/unicorn.stderr.log

Chefの設定を見たいとき(github上で見てもいいけど)

/opt/aws/opsworks/current以下

VPCを設定している場合

Layer設定の「Network > Automatically Assign IP Addresses」のPublic IP addressesを「YES」にしておかないと、Instanceを立ち上げた後ステータスが「booting」のまま変わらなくなる(他に回避策はあるんでしょうけど、とりあえず試したいときはYESにしておいた方がはやい)

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4