Home >Backend Development >PHP Tutorial >Detailed explanation of how to configure virtual host in apache_PHP tutorial
1. Open the vhost configuration in the apache configuration file
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Include conf/extra/httpd-vhosts.conf
2.extra directory httpd-vhosts.conf
configuration, there are three: the first DocumentRoot, the absolute directory of the project, followed by /; The second is ServerPath, which is consistent with DocumentRoot; the third is ServerName, the domain name you entered in the browser. For example: test.123.cn
3. Point to the domain name in the hosts file. For example: 127.0.0.1 test.123.cn