wamp用www域名访问怎么配置?

1、先下载wampserver软件安装好,我这里是安装到E盘,目录在E:\wamp\www。软件可以百度搜索自己下载一个。

2、打开文件E:\wamp\bin\apache\apache2.4.9\conf\ ?

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"> ?

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/bbb" ?

ServerName www.bbb.com

<Directory "E:/wamp/www/bbb"> ?

Options Indexes FollowSymLinks ?

AllowOverride All ?

Order allow,deny ?

Allow from all ?

</Directory>

</VirtualHost>

4、然后打开文件C:\Windows\System32\drivers\etc\hosts,解析域名

127.0.0.1 ? www.aaa.com

127.0.0.1 ? www.bbb.com

最后重启服务器就可以在浏览器访问www.aaa.com和www.bbb.com了。