Skip to content

Instantly share code, notes, and snippets.

@Tanapruk
Last active December 12, 2018 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tanapruk/d80e270745f2150cc59a46aa8d3f0cd2 to your computer and use it in GitHub Desktop.
Save Tanapruk/d80e270745f2150cc59a46aa8d3f0cd2 to your computer and use it in GitHub Desktop.
bin's devOps Workshop

create VPC

Instance Installation

Install NodeJS

  • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
  • . ~/.nvm/nvm.sh
  • nvm install 10.14.2
  • node -e "console.log('Running Node.js ' + process.version)"

Install NGINX

  • sudo amazon-linux-extras install nginx1.12

alias with PEM File

  • alias be1='ssh -i '\''~/.ssh/trustmyv.pem'\'' ec2-user@10.0.1.34'

Build and copy zip files to FE server

  • npm install
  • npm run build
  • zip -r dist.zip dist/
  • scp -i ~/.ssh/trustmyv.pem -r dist.zip ec2-user@54.xx.220.53:/data/www/dist.zip
  • scp -i ~/.ssh/trustmyv.pem -r dist.zip ec2-user@3.0.94.216:/data/www/dist.zip

Build and copy zip files to BE server

  • npm install
  • cd..
  • zip -r be.zip be/
  • scp -i ~/.ssh/trustmyv.pem -r sebe.zip ec2-user@54.169.220.53:/data/sebe.zip
  • ssh to the server1 (non root user)
  • scp -i ~/.ssh/trustmyv.pem -r /data/sebe.zip ec2-user@10.0.1.231:/data/
  • ssh to the server2 (non root user)
  • scp -i ~/.ssh/trustmyv.pem -r /data/sebe.zip ec2-user@10.0.1.34:/data/

Root User

Cautions

  • Security rules must allow 80 PORT or you cannot access from Internet Browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment