Apache Virtual Host 多網域網站放置在同一台主機上 [ 虛擬主機 ]

Apache Virtual Host 多網域網站放置在同一台主機上 [ 虛擬主機 ]

Apache Virtual Host 多網域網站放置在同一台主機上 [ 虛擬主機 ]


資料來源: https://blog.xuite.net/tolarku/blog/485166953-Apache+Virtual+Host+%E5%A4%9A%E7%B6%B2%E5%9F%9F%E7%B6%B2%E7%AB%99%E6%94%BE%E7%BD%AE%E5%9C%A8%E5%90%8C%E4%B8%80%E5%8F%B0%E4%B8%BB%E6%A9%9F%E4%B8%8A

http://inspiregate.com/internet/host-setting/242-apache-virtual-function-the-same-computer-to-run-two-or-more-sites.html


Step 0:DNS 主機設定多個網域名稱對應到同一台主機
Step 1:修改 /etc/httpd/conf/httpd.conf
Step 2:重新啟動 httpd 測試

NameVirtualHost 127.0.0.1:80

<VirtualHost *:80>
    ServerAdmin yourname@domain.com
    DocumentRoot "E:/sexywp.com/wordpress-latest"
    ServerName wplatest.com
    ServerAlias www.wplatest.com
    ErrorLog "logs/wplatest.com-error.log"
    CustomLog "logs/wplatest.com-access.log" combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin yourname@domain.com
    DocumentRoot "E:/sexywp.com/wordpress-2.9.2"
    ServerName wpstable.com
    ServerAlias www.wpstable.com
    ErrorLog "logs/wpstable.com-error.log"
    CustomLog "logs/wpstable.com-access.log" combined
</VirtualHost>

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *