我有一個服務器,在那里我有一個 WHM 面板,有 4 個帳戶,每個帳戶都有它的域。站點 將運行兩個帳戶。其中:Account1 將在埠 3000 上運行 site1 Account2 將在埠 3004 上運行 site2 我需要知道如何使我的 apache 服務器重定向為站點的路由,其中??埠 3000 上的請求轉到 site1,以及從埠 3004 到 site2 的請求。我怎么做?
uj5u.com熱心網友回復:
虛擬主機解決了這個問題,為每個埠/主機創建一個虛擬主機。例子:
<VirtualHost *:3000> # Or any other port
DocumentRoot X:/path/to/site/1 # Remove X: in linux
<Directory X:/path/to/site/1> # Remove X: in linux
Option -Indexes # Disable directory indexing
Allow from all
AllowOverride all # Allow all .htaccess
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/387980.html
標籤:阿帕奇
