Skip to content

Node++ Hello World – Getting Started on Linux

Jurek Muszyński edited this page Apr 5, 2024 · 10 revisions

The steps below are simplified. If you prefer full step-by-step tutorial, it's available here:

Putting your web application online

1. Install C/C++ compiler

sudo yum install gcc-c++          # RH
sudo apt install g++              # Ubuntu

For other distributions see Cheat Sheets.

2. Get Node++

wget https://nodepp.org/nodepp_3.0.1.tar.gz

3. Unpack

mkdir npp_hello
tar xpzf nodepp_3.0.1.tar.gz -C npp_hello

4. Compile

cd npp_hello/src
./m

5. Run in a developer mode (in foreground)

./t

6. Open the browser and navigate to localhost:8080

You should see something like this:

To stop, press Ctrl+C.

For a normal, 'no-hangup mode', there are scripts in bin directory: nppstart and nppstop. Make sure you set $NPP_DIR in your environment, adding to your ~/.bashrc or ~/.bash_profile:

export NPP_DIR=/path/to/npp_hello

To access ports 80 and 443 you need to be root.

Troubleshooting

Closed ports

For your own good, some cloud vendors (AWS being one of them) create instances with a very restricted security policy with only SSH port (22) open. You may need to edit that policy and add HTTP port you want to use, before AWS lets your browser in.

Missing zlib

On some systems you may need to install zlib developer pack:

sudo yum install zlib-devel     # RH
sudo apt install libz-dev       # Ubuntu
Clone this wiki locally