Board logo

標題: [介紹] WAMP 虛擬主機設定方式 [打印本頁]

作者: windows    時間: 2011-8-18 10:39     標題: WAMP 虛擬主機設定方式

首先
1. 編輯 httpd.conf,查找 Include conf/extra/httpd-vhosts.conf,把前面注釋符號“#”刪掉。

2. 找到安裝目錄下 wamp\bin\apache\Apache2.2.17\conf\extra 下 httpd-vhosts.conf 這個文件

3. 把裡面的内容清空掉.舉例換成下面的內容
引用:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.aaa.com.tw
DocumentRoot D:/htdocs/dz
DirectoryIndex index.php index.html index.htm
<Directory "D:/htdocs/dz">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName www.bbb.com.tw
DocumentRoot D:/htdocs/dz2
DirectoryIndex index.php index.html index.htm
<Directory "D:/htdocs/dz2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
4.然後重啟apache,在瀏覽器裡面輸入www.aaa.com.tw 跟 www.bbb.com.tw ,看看設定正不正常囉~~




歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) Powered by Discuz! 6.0.0