- Login to AWS
- Run an instance on AWS EC2
- Store the IP Address of the EC2 instance
- Terminal with SSH Support
- Generate a PEM file from AWS console
- Remotely connect to EC2 from your computer terminal
- One can use Babun Terminal on windows.
- Install Babun
- Check if it supports ssh
- Run ssh on Babun terminal
- Go to the folder in terminal where the PEM file is stored
- Run ls to check if PEM file is available
- Run ssh ex2-user@<ip address> -i <PEM file name>
- Go to root user by running sudo su
- Run node to check if nodejs is installed
- If nodejs is not installed then go to NodeJS website > Go to Download section > Go to Installing NodeJS via package Manager
- Based on EC2 instance select the command and copy
- Node.js v12.x:
# Using Ubuntu curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs # Using Debian, as root curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs
- Find the installation instructions for Ubuntu and Debian here: https://github.com/nodesource/distributions/blob/master/README.md
- Run the above command on terminal
- Run yum install nodejs
- Run node
- If you have your application on github then copy the link
- make a directory using mkdir workspace
- Run cd workspace
- Run ls
- Run git clone <paste github repo link>
- Go in the application folder
- Run cd <folder name>
- Run npm install
- Run node app.js
- Go to AWS console
- Go to EC2
- Under instances add Security Group to your instance
- Go to Inbound
- Add new rule
- TCP - 5000 - Anywhere
- Save the rule
- Type the IP address on browser and add '/5000' in front of it and run it.
- If your app is visible, then it is successful
If you are getting the error: Uncaught TypeError: firebase.database is not a function Resolve it by including firebase-database.js in your html page as follows: <!-- The core Firebase JS SDK is always required and must be listed first --> <script defer src = "https://www.gstatic.com/firebasejs/6.2.4/firebase-app.js" ></script> <script defer src = "https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js" ></script> That is it. Let me know if this was helpful.

Comments
Post a Comment