1. Configure the local DNS file--hosts
File path: C:\Windows\System32\drivers\etc\hosts
2. Configure the Apache Master profile--httpd.conf
Apache Master Profile Path: C:\Program files (x86) \phpstudy\apache2\conf\httpd.conf
Which IP address of the network card to listen to, which port access
The following specifies which IP addresses and ports can be accessed by the virtual host. Where the IP address must be the IP address of its own network card.
3. Configure Apache Virtual host--vhosts.conf
File path: C:\Program files (x86) \phpstudy\apache2\conf\vhosts.conf
Ps:
After configuring the virtual host, why is the localhost access path changed?
Since the virtual host is configured, the first virtual host has the highest priority and is higher than the global configuration. Therefore, when you access localhost, it points to the first virtual host.
That is, as long as Apache is configured with a virtual host, clients accessing the domain name of Apache that do not configure the virtual host will point to the first virtual host by default.
The configuration of the virtual host is too sudden