Monday, 13 March 2017

NodeJS on server thats running multiple sites

im new to publishing website. So my situation is this, in our school, we have a website, then i've done some project and we want to merged it to our school website. www.schoolwebsite.com/myproject so we decided to make it something like that. They're running wordpress website, and my project is built on using MEAN technology (not the one on mean.io). So i transferred all my project files into their FileZilla thing. Then on the server, we installed NodeJS and MongoDB. On my server file(index.js), im listening to PORT 3000, so my angularjs will talk to the www.schoolwebsite.com:3000 to get the API's. so i was able to get it to talk, but the problem is, there is also another website thats been hosted on the same server, Server --> 2 websites (www.schoolwebsite.com and www.somewebsite.com) so both of them have 3000 PORT open (well because they're on the same server)

www.schoolwebsite.com:3000
www.somewebsite.com:3000
123.456.789.123:3000 <-- Example Server IP

So the guy showed me that this is whats happening when i run the "node index.js" it listens to port 3000.

My question is, is there a way in NodeJS to only open the port 3000 on www.schoolwebsite.com Is this a security issue? having both port 3000 on the sites? whats the best practice on this one? thank you!



via John

No comments:

Post a Comment