Reputation: 199
I am building a Node js app hosting platform with AWS Ubuntu.
My requirement is like this,
https://api.example.com
server IP address
169.254.0.0/ahttps://api.example2.com
IP address
169.254.0.0/bhttps://auth.example.com
IP address
169.254.0.0/cSo I want to run node app in the server 169.254.0.0/a (port 80).
How can I achieve this?
Upvotes: 0
Views: 63
Reputation: 1922
I will suggest you use Docker to accomplish this goal. You can follow this simple tutorial or any other that you'd prefer. One beautiful advantage of docker is isolation. An article best explains this and I quote
Isolation
Docker ensures your applications and resources are isolated and segregated. Docker makes sure each container has its own resources that are isolated from other containers. You can have various containers for separate applications running completely different stacks. Docker helps you ensure clean app removal since each application runs on its own container. If you no longer need an application, you can simply delete its container. It won’t leave any temporary or configuration files on your host OS.
There are many other benefits you can read here
Upvotes: 0
Reputation: 6022
You can accomplish this 2 different ways.
1) you can open 3 separate command promps and run / monitor all 3 apps concurrently
2) you can set up crontab to fire them up
This is done by entering crontab -e
/1 * * * * node /var/www/sites/example2.com/a/server.js
/1 * * * * node /var/www/sites/example2.com/b/server.js
/1 * * * * node /var/www/sites/example2.com/c/server.js
Upvotes: 1