First step to AWS
You'll get the fresh machine after register with AWS.
But they provide a user that does not have the power of root. You can write root command with 'sudo su' but launching Node.js process on 80 port is difficult it always gives you The EACCESS Error. Because of Security reasons (For a Reason).
But as a single/Minimal team, you have a handful and trusted people. So you can make that bet on to get access with root with few adjustments at root level.
:Caution:
Take a backup of every file that you change mostly in /etc folder.
Install Node.js
After installing node.js you'll notice that 80 port already occupied either from Nginx/Apache WebServer.
Steps to configure Node.js on 80 port
Open ssh to ubuntu(AWS) with ssh key(Old one)
Write command "sudo su" to gain sudo power
Write command "nano etc/ssh/sshd_config"
look for PasswordAuthentication tag and change its value 'yes'
Login to root and password (If this is first time set new password with passwd)
-
Generate new public and private key in putty generator and keep Public-key ssh-header locally.
Paste (Public-Key:ssh-header) from PuttyGen to /root/.ssh/authorized_keys
-
Keep Private and Public key safe for login via public-key from "ssh-client" such as putty :
{Username:root,Method:Public-key} Add/Import your openSSH private key to your SSH-Client's Client-Key-Manager. sudo service sshd restart
-
Login with ssh now
You may disable the password login and only allow ssh key again. By setting "PasswordAuthentication no" (Recommended) or you may still allow root access with password(Not recommended).
Stop preoccupied service on port 80
Before executing node.js process need to kill occupied 80 port process.
sudo fuser -k 80/tcp
Go Ahead
Go-Ahead run Node.js on port 80 it will work.
Tip:
Use Node.js for APIs.Static assets should serve via NginX.Keep use Multiple database layer for smooth operation.
Top comments (0)