1、httpd.conf中把
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory>
改成
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow # Deny from all </Directory>
2、在httpd.conf末端加上此代码:
<VirtualHost *:80>
DocumentRoot "D:wampwww"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.2:80>
DocumentRoot "D:wampwww est"
ServerName www.test.com
</VirtualHost>
<VirtualHost 127.0.0.3:80>
DocumentRoot "C:UsersAdministratorgitMT58"
ServerName www.zmt.com
</VirtualHost>
3、在C:WindowsSystem32driversetc中找到hosts,最下面修改以下代码:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.2 www.test.com
127.0.0.3 www.zmt.com
# ::1 localhost