- 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 <path-to-pem-file> <root/ubuntu/ec2-user/centos>@<server domain>
- For example
$ ssh -i pemfile.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 following command in order
- Delete old nodejs:
$ sudo apt-get purge nodejs npm
- Add nodejs 6 source:
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- Install nodejs:
$ sudo apt-get install -y nodejs
- To use
node
command:$ sudo ln -s /usr/bin/nodejs /usr/bin/node
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 <path-to-pem-file> <path-to-zip-file> <root/ubuntu/ec2-user/centos>@<server domain>:<folder-name-in-server>
Keep that running and enjoy by going to domain and check.