PHP- local virtual host multi-site configuration

Following environment to build, now a local PHP virtual host multi-site configuration

1. Set the hosts file to configure the virtual domain

hosts file location C: \ Windows \ System32 \ drivers \ etc \ hosts (use Notepad to open, with a tripartite compiler might not have permission, you can not change the content), hosts file to the virtual domain we set point to our local server ip, reach test development of auxiliary functions, and here I directly www.phpstudy.com point to the local server ip, hosts can reach the domain name and set ip has been set for faster access, skip the DNS server, directly back to IP

    

 

 

   

 

 

 2. Set the main Apache configuration file

  Open the httpd.conf file in the conf file in the root directory, find keywords Virtual hosts (virtual host), he uncommented, is to start using virtual host configuration file httpd-vhosts.conf

  

 

 

 

 3. Virtual Host Configuration httpd-vhosts.conf

  httpd-vhosts.conf file directory (Apache root directory \ conf \ extra)

  

 

 

 4. Test results

  

Guess you like

Origin www.cnblogs.com/bai-boy/p/12154636.html