1、开启虚拟主机配置项(以apache为例)

#Include conf/extra/httpd-vhosts.conf
//把前面的#(注释去掉)开启
修改后需重启apache

 

2、设置文件httpd-vhosts.conf(\conf\extra)

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:/wamp/www/renwu" (//文档根目录)
ServerName www.mytest.com (//主机地址)
</VirtualHost>

修改后需重启apache


3、配置hosts文件(c盘...etc目录下)

添加

127.0.0.1 www.mytest.com

注意把前面的#(注释去掉)

相关文章:

  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-10-08
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-11-01
相关资源
相似解决方案