二、配置域名
打開httpd.conf,修改主配置文件,#Include conf/extra/httpd-vhosts.conf
,把#去掉
- 打開httpd-vhosts.conf配置:

三、設置域名映射同一個IP,修改hosts
打開C:\Windows\System32\drivers\etc下的hosts文件,最后一行添加如下命令:127.0.0.1 test1.io
。
四、修改端口
進入httpd.conf
將原來的
Listen 80
改為
Listen 80
Listen 8080
<VirtualHost 8080>
DocumentRoot "D:/phpstudy/PHPTutorial/WWW/test1"
ServerName test1.io
</VirtualHost>