Apache Virtual Host 多網域網站放置在同一台主機上 [ 虛擬主機 ]
Apache Virtual Host 多網域網站放置在同一台主機上 [ 虛擬主機 ]
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>