與 apache 網絡服務器和 Node.js REST 服務器共享 HTTP 端口 80 (Share HTTP port 80 with apache webserver and Node.js REST server)


問題描述

與 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_wkuser368191Kartikeya Sharma)

參考文件

  1. Share HTTP port 80 with apache webserver and Node.js REST server (CC BY‑SA 2.5/3.0/4.0)

#port #webserver #apache #restify #node.js






相關問題

使用java應用程序在linux中打開端口 (Open port in linux with java application)

如何在linux中了解特定端口的流量 (How to know traffic to a specific port in linux)

HDMI 連接不發送 WM_DEVICE_ARRIVAL 消息 (HDMI Connection Does Not Send WM_DEVICE_ARRIVAL Message)

移植安卓4.2 (Port android 4.2)

如何等到服務器上線才能訪問 REST API (How to wait till a server goes online to access a REST API)

與 apache 網絡服務器和 Node.js REST 服務器共享 HTTP 端口 80 (Share HTTP port 80 with apache webserver and Node.js REST server)

lighttpd:身份驗證後如何將端口(僅對本地主機可見)轉發到 WAN? (lighttpd: How to forward port (visible only to localhost) to WAN after authentication?)

通過警報端口重定向所有程序數據包 (Redirect all program packets through alerternate port)

在同一台計算機上的兩個程序之間發送和接收 UDP 數據包 (Sending and receiving UDP packets between two programs on the same computer)

是否可以更改 WAMP 調用的 url? (Is it possible to change the url called by WAMP?)

ServerSelectionTimeoutError:documentdb.documents.azure.com:10255:超時 (ServerSelectionTimeoutError: documentdb.documents.azure.com:10255: timed out)

kubernetes 正在暴露未聲明的端口 (kubernetes is exposing not declared port)







留言討論