1. Open the Apache configuration file httpd. conf and remove the # include CONF/extra/httpd-vhosts.conf before #!!
2. Open the Apache/CONF/extra sub-configuration file httpd-vhosts.conf under Apache
3. Delete the original extension configuration file (as follows) under this file: delete one or two
<Virtualhost*: 80>Serveradmin [email protected] DocumentRoot/www/docs/dummy-host2.localhost servername dummy-host2.localhost errorlog logs/dummy-host2.localhost-error_log customlog logs/dummy-host2.localhost-access_log common</Virtualhost>
4. Add at the end of the httpd-vhosts.conf file:
<Virtualhost*: 80>DocumentRoot D:/Wamp/website/a.com servername www.a.com<Directory"D:/Wamp/website/a.com">Options indexes followsymlinks AllowOverride none order allow, deny allow from all</Directory></Virtualhost>
5. Open the hosts file in C:/Windows/system32/Drivers/etc and add the following content
127.0.0.1 www.a.com
6. In this way, we have configured the virtual host named Wamp. Restart the host and enter Wamp in the browser to view the content under the D:/Wamp/WWW directory !!
7. But there is a problem with localhost access. In this case, we need to set localhost as a virtual host.
<Virtualhost*: 80>DocumentRoot D:/Wamp/WWW servername localhost<Directory"D:/Wamp/www">Options indexes followsymlinks AllowOverride none order allow, deny allow from all</Directory></Virtualhost>
8. To allow other computers to access the computer using IP addresses, search for 127.0.0.1 in httpd. conf and change it to all.