Deploy(AWS)
windows : putty 이용
mv Downloads/파일이름 ~/pems/
chmod 400 pems/0917_inhatastingparty.pem => 권한
ssh -i ~/pems/*.pem ec2-user@IP
sudo yum search git -> git으로 깔 수 있는거
git-all.noarch 깔기
sudo yum install git-all.noarch
git clone https://github.com/yoohoogun114/
git remote https://github.com/yoohoogun114/
디렉토리로 접근
rvm.io에서 루비깔고
( $ 넣지말고 \ 넣지말고 복사)
터미널에서 인스톨
source ~/.profile 입력
rvm install ruby
pwd 현재 있는 디렉토리
gem install bundler
ls
bundle install
gem install passenger
cd
sudo passwd
su
sudo chmod o+x "/home/ec2-user"
sudo yum search curl
sudo yum install libcurl-devel.x86_64
passenger-install-nginx-module
ruby 선택
복붙
용량문제 해결
sudo dd if=/dev/zero of=/swap bs=1M count=1024
sudo mkswap /swap
sudo swapon /swap
sudo chmod o+x "/home/ec2-user"
passenger-install-nginx-module
exit (루트작업 끝)
sudo vi /opt/nginx/conf/nginx.conf
vim열어서
server{
listen 80;
server_name inhatastingparty.com;
passenger_enabled on;
root /home/ec2-user/inha_tastingparty/public;
}
:wq => 종료후종료
도메인 dns 연결 설정
aws에서 security group에서 inbound 설정 (http anywhere)
서버 종료
sudo kill $(cat /opt/nginx/logs/nginx.pid)
sudo /opt/nginx/sbin/nginx
서버시작
vi gemfile 수정 the ruby racer
vi /opt/nginx/logs/error.log
vi /opt/nginx/logs/access.log
=> secrets error => config/secrets.yml 문제
vi Gemfile
figaro gem 설치후
bundle exec figaro install
rake secret
vi config/application.yml
touch tmp/restart.txt
서버 재시작
rake db:migrate RAILS_ENV=production
rake db:drop RAILS_ENV=production
rails c
development 에추가한거 => product에도 추가 => malign
tail -f production.log
RAILS_ENV=production bin/rake assets:precompile
rake assets:clean RAILS_ENV=production
passenger start -p 9292
http://stack.likelion.net/questions/detail/822
rackup config.ru -s thin -E production -p 9292
passenger start -p 9292
rails console production