1. httpd.conf find the following two lines to remove the comment:
# Include Conf/extra/httpd-vhosts.conf
# Include Conf/extra/httpd-vhosts.conf
2. httpd-vhosts.conf file, add multiple Site Settings:
##<virtualhost *:80>
# #ServerAdmin [email protected]
# #DocumentRoot "D:/xampp/htdocs/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>
According to the sample, remove the comment, except DocumentRoot, dummy-host2.example.com instead of the host name you need, for example, www.tp5.com
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "D:/xampp/htdocs/tp5/public"
ServerName www.tp5.com
Errorlog "Logs/www.tp5.com-error.log"
Customlog "Logs/www.tp5.com-access.log" common
</VirtualHost>
Change the value of DocumentRoot to the directory corresponding to the site
3. The host file adds the domain name resolution, for example: 127.0.0.1 www.test.com
4. Restart Apache.
Configuring multiple sites under Windows Apache