I have full access to a cloud server (running Ubuntu 14.04) via SSH.
I already have installed Node.JS from PPA:
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js -y
sudo apt-get update
sudo apt-get install nodejs -y
Now, I want to set up my first Node.JS application on my cloud server. It will send a Hello World
message from server to client.
require("http").createServer(function (req, res) {
res.end("Hello World!");
}).listen(3000);
Then:
$ node my-script.js
What are the steps to allow users to see this hello world message at a custom domain (e.g. example.com
)?
http://example.com:3000
they'll see your message?production.example.com
will getHello World!
response.EACCES
error forlisten(80)
.sudo
, then it works fine! But, how can I avoid running the process withsudo
?