Skip to main content

Deploying node application to aws

 steps 1) log in to AWS Console

step 2) select region o top right corner ( place and select mumbai region  )

step 3)  click on services on top left corner and select EC2  

step 4) you will be redirected to instance page and it shows already running instances ....and click on lanunch instance to create new instance

step 5) after clicking launch instance then select Amazon Machine Image ( which is OS type) and also click Free tier on left side 

step 6) select 64 bit ubauntu machine ,  then select t2.micro which is free tier and also shown in green color

step 7) click on review and launch

step 8) then choose either existing key or new key  , then give key pair name and then download file.

step 9)  click on launch button to launch instance

step 10) go to instance page then click on instance and then click on connect button then select ssh client

step 11) run following command in downloads terminal 

              chmod 400 keypairname (oly for first time)

step 12) then copy ssh command to connect to instance from local system

****************** above steps are to create instance & to connect to instance *************

procedure to install node js  in  virtual server

step1) visit the following link to go through guide for installing node js

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html    (do almost all commands  & this install is done through NVM)

step 2) install mariadb with the following link

https://yottabrain.org/database/mysql/install-mariadb-in-aws-ec2/ (oly first two commands)

then as ther will be no intiall password set so type this command sudo mysql -u root  to login and create a user and grant all previlages 

commands to create user & give privilages

1) CREATE USER 'username'@loaclhost  IDENTIFIED BY   'password'

2) GRANT ALL PRIVILEGES ON  *.* TO  'username'@localhost IDENTIFIED BY  'password';

3) FLUSH PRIVILEGES

then create database and import database in ec2 instance 

************  above are steps to install nodejs and mariadb  in ec2 instances ************


      Steps to move files from local system to ec2 

scp -i ./awsin2.pem ./awsdb.sql/  ubuntu@ec2-13-235-114-62.ap-south-1.compute.amazonaws.com:

awsin2.pem  - this is key file

awsdb.sql - this can be any file , you want to push

ubuntu@ec2-13-235-114-62.ap-south-1.compute.amazonaws.com:- this is instance address

any file you want to psuh should be copied in downloads file  i.e location of pem file 

Next steps 

import database then clone git hub code & make some changes in .env and config file


then check server running by cmd  node server.js ,,,,, if every thing is good , then we have to make run port 8000 for ever....

installing PM2 for continous running server

1)npm install pm2  -g

2) then start server by following command

pm2 start server.js 

>> then final step is install nginx and configuring it.....


Comments

Popular posts from this blog

How to use Google images without copyright issue

Every blogger or youtuber makes use of variety of images in their post,as it enhances the quality of the post and also it is very effective way to make their audience understand.But all the images that you get on google are not free,because some of the images may have copyright.So usage of such images may lead to problems. Hence I try to describe some methods to get free images without copyright , so that you can use those images in your blog or video. Here are some steps to follow 1.  In your PC go to search engine and type the name of the image that you need 2.  click on image button, which will redirect image page. 3.  click on the tools button which is next to settings (for better understanding it is marked in red color) 4.  By clicking on the tools button, you will find,below some options 5. click on the third option i.e usage rights ( for better understanding it is marked in red color) 6. By clicking on the usage rights, you wil...

Integration of tailwind css with react application

 steps 1)  open termianl create react app with npx create-react-app command 2) then install packages with following command  npm i -D tailwindcss postcss-cli autoprefixer 3) then create tailwind config file , with following comman npx tailwind init tailwind.js  --full 4) create post css config file with following command  touch postcss.config.js 5) then finally put follwing code in post css config fil e const tailwindcss = require ( 'tailwindcss' ) module . exports ={ plugins : [ tailwindcss ( './tailwind.js' ), require ( 'autoprefixer' ) ] } 6) then create assests folder and inside it create main.csss and tailwind.css file 7) then in tailwind.css file place the following code 8) place following code in package.json 9th step final in package.json file 9 th step "start" : " npm run watch:css && react-scripts start" , "build" : "npm run build:css &&react-scripts build" , 8th s...

ನಮ್ಮ ಕನ್ನಡ ನಮ್ಮ ಹೆಮ್ಮೆ.

ಇಂದು ನವೆಂಬರ್ 1, ಕನ್ನಡ ರಾಜ್ಯೋತ್ಸವ ! ಎಲ್ಲೆಲ್ಲೂ ಕನ್ನಡದ ಕಲರವ, ಕನ್ನಡ ಹಬ್ಬದ ಸಂಭ್ರಮ. ಅಬ್ಬಾ! ಕನ್ನಡ ಹಾಗೂ ಕರ್ನಾಟಕ ಎಂಬ ಶಬ್ದ ಕಿವಿಗೆ ಬಿದ್ದ ಕೊಡಲೆ ಅದೆನೋ ರೋಮಾಂಚನ ಅದೆನೋ ಆನಂದ. ಕನ್ನಡದ ಹಿರಿಮೆ, ಗರಿಮೆಯನ್ನು ವರ್ಣಿಸಲು ಪದಗಳೇ ಸಾಲುವುದಿಲ್ಲ, ಅಷ್ಟು ಅಧ್ಬುತ ನಮ್ಮ ಕನ್ನಡ. ನಮ್ಮ ನಾಡು  ಅನೇಕ ಸಸ್ಯ ಸಂಪತ್ತು , ಪ್ರಾಣಿ ಸಂಪತ್ತುಗಳಿಂದ ಕೂಡಿದ ಸಂಪದ್ಭರಿತ ನಾಡು. ಕನ್ನಡದ ಹಿರಿಮೆಯನ್ನು , ಎತ್ತರವನ್ನು , ಸಾಂಕೇತಿಕವಾಗಿ ಹೇಳುವ , ಮುಗಿಲು ಮುಟ್ಟವ ಗಿರಿ ಶಿಖರಗಳಿಂದ ಕೂಡಿದ ನಾಡು.ತನ್ನ ಸುಂದರವಾದ   ಹರಿಯುವ ಶಬ್ದದ ಮೂಲಕ, ಕನ್ನಡ ಭಾಷೆಯ ಇಂಪನ್ನು ತಿಳಿಸುವ ನದಿಗಳ ಹಾಗೂ ಭೋರ್ಗರೆಯುವ ರಮಣೀಯ ಜಲಪಾತಗಳ ದಿವ್ಯ ನಾಡು ನಮ್ಮ ಕನ್ನಡ ನಾಡು.ಒಟ್ಟಿನಲ್ಲಿ ನಮ್ಮ ಹೆಮ್ಮೆಯ ಕನ್ನಡ ನಾಡು,ನಿಸರ್ಗ ಸಂಪತ್ತಿಯಿಂದ ಕೂಡಿದ ಸುಂದರ ನಾಡು. ಕಲೆ , ಸಾಹಿತ್ಯ , ಸಂಗೀತ , ನೃತ್ಯ , ವಿಜ್ಞಾನ, ತಂತ್ರಜ್ಞಾನಗಳ ನಿಧಿ ನಮ್ಮ ಹೆಮ್ಮೆಯ ಕನ್ನಡ ನಾಡು.ಈ ಎಲ್ಲ ಕ್ಷೇತ್ರಗಳಿಗೂ ಕರ್ನಾಟಕದ ಕೊಡುಗೆ ಅಪಾರ ಹಾಗೂ ಅದ್ಭುತ.  ಹೀಗೆ ಹೇಳುತ್ತಾ ಹೋದರೆ ಅದಕ್ಕೆ ಕೂನೆಯೆ ಇಲ್ಲ.ಕನ್ನಡದ ಹಿರಿಮೆಯನ್ನು ವರ್ಣಿಸಲು ಪದಗಳೇ ಸಾಲುವುದಿಲ್ಲ.ಇಂತಹ‌ ಅದ್ಭುತ ಕನ್ನಡ ನಾಡಿನಲ್ಲಿ ಜನಿಸಿದ ನಾವೇ ಧನ್ಯರು ! ಕನ್ನಡ ಭಾಷೆ ಅನೇಕ ಸಾಹಿತ್ಯ ರತ್ನಗಳಿಂದ ಶೋಭಿತವಾದ ಸಿರಿವಂತ ಭಾಷೆ.ಸುಮಾರು ಎರಡು ಸಾವಿರ ವರ್ಷಗಳ ದೀರ್ಘ ಇತಿಹಾಸ ಇರುವ ಸುಂದರ ...