2

I have a server behind the corporate firewall with only port 80 open. Is there any way to run Apache and Node.js separately on the same domain, but different urls? For example, can I run Apache on mydamain.com and Node on mydomain.com/vcard?

4

You can. You have 3 possible setups:

  • node listens at port 80 and redirects certain requests to Apache listening at port 8000
  • Apache listens at port 80 and redirects certain requests to node listening at port 8000
  • A separate reverse proxy (Nginx, HAProxy or another one) redirects requests to either Apache listening on port 8001 or Node listening on port 8002.

Given that Apache is your corporate server, the second way is the safest. Read the documentation on Apache mod_proxy module on how to do so. You can have either a separate "folder" for Node (e.g. all requests to http://yourcompany.com/node/blabla are served by node while all other requests are served by Apache, or you can have a separate virtual host for Node.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.