How do I create an HTTP server with Node.js on a DreamHost VPS running Apache?

StackOverflow https://stackoverflow.com/questions/17582891

  •  02-06-2022
  •  | 
  •  

سؤال

I've installed Node.js on my DreamHost VPS (basically a virtual machine), but my VPS hosts a lot of other websites using Apache. How can I bind an HTTP listener to a specific domain using Node.js, so that when I visit "mynodejsdomain.com", I get responses from my Node.js code, but when I visit "myotherdomain.com", I get responses from Apache/PHP?

هل كانت مفيدة؟

المحلول

Turns out I needed to tell Apache to forward the requests for that domain, and DreamHost provides a nice frontend for mod_proxy:

http://wiki.dreamhost.com/Proxy_Server

Thanks, CodeCaster!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top