1. Win10on the system, "start" -"All Apps" -"WindowsAccessories " -Notepad, right-click the "Run as administrator" Notepad. Select "File" -" open" menu, go to "C:\Windows\System32\drivers\etc"directory, you do not see any files (Windowshidden), type "file name" at "hosts", press" open ". You can edithostsfile.
2. Copylocalhostthe line, will be the new line of "localhost"Change intoWuxing-testing.info;
127.0.0.1 Wuxing-testing.info
3. Editd:/wamp/bin/apache/apache2.4.9/conf, open the virtual host configuration file:
# Virtual Hosts
Include conf/extra/httpd-vhosts.conf
4. Modifyconf/extra/httpd-vhosts.conf, add the following configuration to the end of the file:
<virtualhost *:80>
documentroot "D:/wamp/www"
ServerName localhost
</VirtualHost>
<virtualhost *:80>
documentroot "D:/wuxing-testing.info"
ServerName wuxing-testing.info
</VirtualHost>
<directory "d:/Wuxing-testing.info" >
Options Indexes followsymlinks
allowoverride All
<ifdefine apache24>
Require Local
</IfDefine>
<ifdefine! Apache24>
Order Deny,allow
# Deny from all
# allow from localhost:: 1 127.0.0.1
allow from all
</IfDefine>
</Directory>
LoadModule Rewrite_module modules/mod_rewrite.so
The configuration is complete.
Hostsdomain name does not takewww, in the virtual host configurationServeralias, trying to getApacheParse Bandwwwdomain name, the discovery is not working at all in the native environment. Maybe it's because "www "This host name andDNSservice closely related to it.
WIN10 System configuration Apache Virtual Host