Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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 (http://httpd.apache.org/docs/2.1/mod/mod_proxy.html) 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.

share|improve this answer
    
ProxyPass works as charm! Thank you! –  tambourine Sep 15 '11 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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