Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to Setup Node and Express on Amazon Web Services EC2
ChannelMicrowaveSamDescription from the creator
How to Setup Node and Express on Amazon Web Services EC2
1) Make an account on Amazon Web Services
aws.amazon.com/
2) Create a vanilla Ubuntu micro EC2 instance
3) Security
Open HTTP, HTTPS, Port 8080, and Port 9000
4) Launch the instance and save the pem file (private key)
5) Make sure that pem file has correct permissions
chown :Users node.pem
chmod 600 node.pem
5) Update Ubuntu and install these packages
sudo apt-get update
sudo apt-get install libssl-dev g++ make
6) nodejs.org/download/
(Get node source files)
wget nodejs.org/dist/v0.10.32/node-v0.10.32.tar.gz
7) Extract the packed tar.gz and change directory
tar -xvf node-v0.10.32.tar.gz
cd node-v0.10.32
8) Execute the binaries, make, and install
./configure && make && sudo make install
9) cd ../
mkdir test1
cd test1
vim test1.js
(Insert is to edit as esc :x is to save)
10) var http = require('http');
var port = 9000;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello there, world!\n');
}).listen(port);
console.log('Listening on port', port);
11) node test1.js (to run the javascript file on node)
CTRL+C to exit command
nohup node test1.js & (to run as a background process - no hiccup)
ps -ef (to check all background processes)
kill id_number
12) cd /home/ubuntu
sudo npm install express
13) mkdir test2
vim test2.js
var express = require('express');
var app = express();
app.get('/', function (req, res){
res.send('Hello there, world!\n');
});
var port = 9000;
app.listen(port);
console.log('Listening on port', port);
14) Reroute IP Tables so that javascript file also displays on port 80
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
Twitter: twitter.com/microwavesam
1) Make an account on Amazon Web Services
aws.amazon.com/
2) Create a vanilla Ubuntu micro EC2 instance
3) Security
Open HTTP, HTTPS, Port 8080, and Port 9000
4) Launch the instance and save the pem file (private key)
5) Make sure that pem file has correct permissions
chown :Users node.pem
chmod 600 node.pem
5) Update Ubuntu and install these packages
sudo apt-get update
sudo apt-get install libssl-dev g++ make
6) nodejs.org/download/
(Get node source files)
wget nodejs.org/dist/v0.10.32/node-v0.10.32.tar.gz
7) Extract the packed tar.gz and change directory
tar -xvf node-v0.10.32.tar.gz
cd node-v0.10.32
8) Execute the binaries, make, and install
./configure && make && sudo make install
9) cd ../
mkdir test1
cd test1
vim test1.js
(Insert is to edit as esc :x is to save)
10) var http = require('http');
var port = 9000;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello there, world!\n');
}).listen(port);
console.log('Listening on port', port);
11) node test1.js (to run the javascript file on node)
CTRL+C to exit command
nohup node test1.js & (to run as a background process - no hiccup)
ps -ef (to check all background processes)
kill id_number
12) cd /home/ubuntu
sudo npm install express
13) mkdir test2
vim test2.js
var express = require('express');
var app = express();
app.get('/', function (req, res){
res.send('Hello there, world!\n');
});
var port = 9000;
app.listen(port);
console.log('Listening on port', port);
14) Reroute IP Tables so that javascript file also displays on port 80
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 9000
Twitter: twitter.com/microwavesam
About this tutorial
MicrowaveSam published this 31:30 video tutorial on October 31, 2014. It has been watched 113,143 times on YouTube.
- Channel
- MicrowaveSam
- Category
- Howto & Style
- Duration
- 31:30
- Published
- October 31, 2014
- Views
- 113,143
- Likes
- 1,361
Tags
Share
This tutorial in other languages
- FRComment installer et nœud Express sur Amazon Web services EC2
- ESCómo configurar nodos y Express en Amazon Web Services EC2
- PTComo a configuração do nó e Express no Amazon Web Services EC2
- ITCome impostare Node ed Express su Amazon Web Services EC2
- DEWie Setup Knoten und Express auf Amazon Web Services EC2
- NLHoe je Node en Express op Amazon Web Services EC2
- RUКак установить узел и Экспресс на Amazon Web Services EC2
- PLJak skonfigurować węzeł i Express na Amazon Web Services EC2
- JAどのようにAmazon WebサービスEC2上のセットアップノードとエクスプレスへ
- ARكيفية إعداد عقدة وExpress على الأمازون خدمات ويب EC2
- HIकैसे सेटअप नोड और पर अमेजन वेब सेवाओ EC2 एक्सप्रेस के लिए
- IDCara Setup Node dan Express di Amazon Web Services EC2