1、Apache\conf\httpd.conf
去掉 #Include config/extra/httpd-vhosts.conf 前面的#
2、Apache\conf\extra\httpd-vhosts.conf
把
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "G:/Doc/Study/PHP/php/TP"
ServerName www.b.com
ServerAlias www.b.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
前面的#去掉
DocumentRoot 文件目录
服务名称 解析的地址
3、配置hosts
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 地址
时间: 2024-10-14 09:07:54