1. Configure Wamp website address:
Locate the Wamp installation directory, such as ~\wamp\bin\apache\apache2.4.4\conf\extra\httpd-vhosts.conf
Open httpd-vhosts.conf File
There are default examples:
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
Errorlog "Logs/dummy-host2.example.com-error.log"
Customlog "Logs/dummy-host2.example.com-access.log" common
</VirtualHost>
When we configure our own site, we can simply point to:
<virtualhost *:80>
DocumentRoot "e:demo/test01" (here is the path to set the site)
ServerName test01.com (here is the domain name to set up the site)
</VirtualHost>
After the settings are saved, any changes to the configured operation are restarted Wamp.
2. Configure Apache:
To open a httpd.conf file, refer to: http://www.cnblogs.com/junglexj/p/6016755.html
Place them
# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf
The second line "#" is removed, indicating permission;
Before you find the <directory "E:/demo" >, set it to
# onlineoffline Tag-don ' t remove
Order Deny,allow
Allow from all
#Allow from 127.0.0.1
3. Configure the Hosts file
Catalog: C:\Windows\System32\drivers\etc\hosts
Add a row at the bottom
127.0.0.1 test01.com
Save exit, if unable to save please copy a Hosts file to desktop editing, and then replace to C:\Windows\System32\drivers\etc directory.
Can be tested in a new PHP file, e:/demo/test01/index.php
The contents of index.php are as follows:
<?php
echo "Hello World";
?>
Save, in the browser access http://test01.com/test01/can display "Hello World";
Note that if you modify the default port, add the port number after the domain name , for example: http://test01.com:8080/test01/
Reference: http://www.imooc.com/video/3521
Wampserver Multi-site configuration