簡體   English   中英

停止 apache 並運行節點服務器

[英]Stop apache and run node server

我有一個安裝了 whm 面板的 centos 7.9 linux 服務器。 Apache是直接安裝在我創建的域名上的,我不想在一個域名的子域上運行apache。 我想運行一個節點 js 服務器。 當我說“service httpd stop”時,它們都關閉了。 該怎么辦?

網絡服務不會將自己綁定到特定的主機名。 您有一台 Apache 服務器正在運行。 任何到端口 80 的連接都將連接到該服務器。 Apache 然后查看 HTTP 請求中的host header 以確定響應的網站。

如果您希望一個站點使用 Node.js,那么您需要選擇以下選項之一:

  • 將 Apache 配置為 Node.js 托管服務器的反向代理
  • 在另一台計算機上運行 Node.js 服務器並將主機名指向該計算機
  • Have multiple network interfaces for the existing computer, with their own IP addresses, configure Apache to listen on one and Node.js to listen on the other, then point the hostnames at the right IP addresses.

(我不推薦最后一個,因為它是最繁瑣的)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM