1、先下載wampserver軟體安裝好,我這裡是安裝到E盤,目錄在E:\wamp\www。軟體可以百度搜索自己下載一個。
2、開啟檔案E:\wamp\bin\apache\apache2.4.9\conf\httpd.conf;
然後找到下面這個模組#Include conf/extra/httpd-
vhosts.conf
3、開啟路徑檔案E:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-
<VirtualHost *:80>
ServerAdmin webmaster@dummy-
host2.example.com
DocumentRoot "E:/wamp/www"
ServerName 127.0.0.1
ServerAlias localhost
<Directory "E:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
DocumentRoot "E:/wamp/www/aaa"
ServerName www.aaa.com
<Directory "E:/wamp/www/aaa">
1、先下載wampserver軟體安裝好,我這裡是安裝到E盤,目錄在E:\wamp\www。軟體可以百度搜索自己下載一個。
2、開啟檔案E:\wamp\bin\apache\apache2.4.9\conf\httpd.conf;
然後找到下面這個模組#Include conf/extra/httpd-
vhosts.conf
,去掉前面#,這樣就可以開啟httpd-vhosts虛擬主機模組。3、開啟路徑檔案E:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-
vhosts.conf
。把要解析的域名配置上去,還有域名繫結的目錄。參考如下<VirtualHost *:80>
ServerAdmin webmaster@dummy-
host2.example.com
DocumentRoot "E:/wamp/www"
ServerName 127.0.0.1
ServerAlias localhost
<Directory "E:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-
host2.example.com
DocumentRoot "E:/wamp/www/aaa"
ServerName www.aaa.com
<Directory "E:/wamp/www/aaa">