問題描述
與 apache 網絡服務器和 Node.js REST 服務器共享 HTTP 端口 80 (Share HTTP port 80 with apache webserver and Node.js REST server)
過去,我在 WAMP(Windows、Apache 服務器、MySQL、PHP)上構建了一個 REST API 服務器。最近,我用 node.js restify 構建了一個 REST API 服務器。但是,我不能將端口 80 用於 node.js REST 服務器,因為與 Apache 服務器存在衝突。如何與 apache 網絡服務器和 Node.js REST 服務器共享端口 80?
WAMP版本沒有這個問題。REST 服務器和網絡服務器都使用 HTTP 端口 80。
參考解法
方法 1:
No port can be shared with 2 listeners. only one application can listen on a port, either apache or node process.
When you say you used it in the past, i am assuming you made 2 web APIs/Apps both hosted from the same apache server. is that correct? If that is correct, then that clarifies earlier you had not two but one web server apache running on port 80, isn't it?
方法 2:
I also had the same problem , My two applications were running on the same port, so moved one the application to 8080 port , it started working fine . You can go for also by securing one of them , then it will be at different domains according the browser.Specify the IP address , don do it for "localhost"
(by guagay_wk、user368191、Kartikeya Sharma)