0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS関連

Last updated at Posted at 2016-06-19

秘密鍵のパーミッションを変更
所有者のみ読み込み可能(下記コマンドを実行後、SSHでEC2にログインできるようになった。)
chmod 400 hoge-key.pem

ローカルからEC2へのログインは.sshディレクトリに移動してから行う
vagrant@vagrant-ubuntu-trusty:~$ cd .ssh
vagrant@vagrant-ubuntu-trusty:~/.ssh$ ssh -i hoge_key.pem ec2-user@12.345.67.890

vagrantユーザは、ec2-userと同じく、sudoを実行できる
vagrant@vagrant-ubuntu-trusty:/var$ mkdir -p www/test_app
mkdir: cannot create directory ‘www’: Permission denied
vagrant@vagrant-ubuntu-trusty:/var$ sudo mkdir -p www/test_app

vagrant@vagrant-ubuntu-trusty:/var/www/test_app$ git clone git@github.com:hogehoge/fugafuga_service.git
fatal: could not create work tree dir 'fugafuga_service'.: Permission denied
vagrant@vagrant-ubuntu-trusty:/var/www/test_app$ sudo git clone git@github.com:hogehoge/fugafuga_service.git

ローカルでのアプリの作成
「cd /var/www」では、「rails new -d hoge_app -d postgresql」、は実行できない。「rails -v」コマンドを実行してもRailsのバージョンは表示されない。

vagrant@vagrant-ubuntu-trusty:~$ pwd ※ここで、「rails -v」を実行すると、Railsのバージョンは表示される。
/home/vagrant
vagrant@vagrant-ubuntu-trusty:~$ rails new -d hoge_app -d postgresql ← で、行う!!
vagrant@vagrant-ubuntu-trusty:~$ ls
archive hoge_app

vagrant(Ubuntu)にログインしたらまず行うこと
sudo apt-get update
sudo apt-get upgrade
参考サイト
http://qiita.com/kazoo04/items/289c4f6a8501df3a7359
http://webkaru.net/linux/apt-get-command/

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?