Guide to connect and deploy AWS Server
What should we need?
- PEM file containing private key from AWS server.
- A domain to server
- GIT Bash (In Window, can't use command line tool or powershell).
Steps: Step 1: Connect to server: In Window, open GIT Bash and run: ssh -i [Direction to PEM File] [using either root, ubuntu or ec2-user, centos]@[server domain] For example: ssh -i phatHong.pem [email protected] (Reference: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectingMindTerm)
Connect is success in case your commandline changed to your remote server machine ip and name.
Step 2: Installing Stubs: We need node for environment, npm for installing packages from your project, git for version controlling (or pull push), unzip for unzip compressed files (*.zip), http-server for running server.
- Step 2.1 Install YUM (It is first thing to install) Running Command: sudo apt-get install yum. To install YUM
TroubleShooting: In Case of error in above command. Run : sudo apt-get update
- Step 2.2 Install NodeJS Latest version Running following command in order
- sudo apt-get purge nodejs npm
- curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo apt-get install -y nodejs to install nodejs
- Step 2.3 Verify that nodejs is installed correctly 2.3.1 Run node -v to verify that node is installed 2.3.2 In case of it throw error or not return the current node version. We check command: nodejs -v.
(Reference: https://codeforgeek.com/2015/05/setup-node-development-environment-amazon-ec2/)