- 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:
- 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]
Connect is success in case your commandline changed to your remote server machine ip and name.
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.
Running Command: sudo apt-get install yum
. To install YUM
TroubleShooting: In Case of error in above command. Run : sudo apt-get update
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
2.3.2 In case of it throw error or not return the current node version. We check command: nodejs -v
.
2.3.3 If nodejs -v
return node version. we need to map nodejs to node. If not, we have to reinstall node again.
Run commands:
sudo apt-get install git
sudo apt-get install npm
sudo apt-get install unzip
npm i http-server -g
Step 3.3: We run: scp -i [local file PEM] [Directory to local zip file] [using either root, ubuntu or ec2-user, centos]@[server domain]:[Directory to folder on server]
Keep that running and enjoy by going to domain and check.