【Foreword】
After Apache configures a virtual host, it cannot access localhost, but can only be accessed by setting a virtual domain name.
By turning localhost into a virtual domain name.
Reference file: http://570109268.iteye.com/blog/2414410
【main body】
(1) Set up a virtual domain name
First set the virtual domain name localhost in httpd-vhosts.conf
<VirtualHost _default_:80> DocumentRoot "C:\phpStudy\" ServerName localhost </VirtualHost>
(2) Comment out the line ServerName localhost:80 in the httpd.conf file
(3) Don't forget to check whether the hosts file is bound to localhost pointing to 127.0.0.1, which will normally exist
(4) The second important point is to comment out the ServerName localhost:80 of the httpd.conf file
.