第一步:配置 httpd.conf

    开启 虚拟主机 配置模块 去掉 " Include conf/extra/httpd-vhosts.conf "  前面的" # "

 Includeconf/extra/httpd-vhosts.conf

同时添加一个Listen 80

第二步:配置 httpd-vhosts.conf

    开始 将自定义的本地域名 与 web目录 关联  这里自定义了

www.lich.org

www.lich.com

www.lichina.com

这三个本地域名 (当然这三个域名 是不能远程访问的 什么原因 你懂的!)

NameVirtualHost *:80

<VirtualHost *:80>
ServerName *
DocumentRoot D:\web\apache2.2\Apache2\htdocs
</VirtualHost> <VirtualHost *:80>
ServerName www.royal.org
DocumentRoot "D:\web\apache2.2\Apache2\htdocs\Royal"
<Directory "D:\web\apache2.2\Apache2\htdocs\Royal">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost> <VirtualHost *:80>
ServerName www.superapp.com
DocumentRoot "D:\web\apache2.2\Apache2\htdocs\scApp7"
<Directory "D:\web\apache2.2\Apache2\htdocs\scApp7">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost> <VirtualHost *:80>
ServerName www.api.com
DocumentRoot "D:\web\apache2.2\Apache2\htdocs\taobaoApi"
<Directory "D:\web\apache2.2\Apache2\htdocs\taobaoApi">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

  

第三步: 配置windows hosts文件

    打开 C:\WINDOWS\system32\drivers\etc\hosts 文件

(hosts文件其实 就是 internet 的雏形 最早的internet 是 ARPA 用于内部的 主机的域名解析)

127.0.0.1 localhost
127.0.0.1 www.lich.org
127.0.0.1 www.lich.com
127.0.0.1 www.lichina.com

  第四步:没哟了! 在浏览器上 输入 www.lichina.com  www.lich.com  www.lich.org  就会访问不同的本地web目录

最新文章

  1. 下拉列表 select-option ; select-optgroup-option
  2. Web端PHP代码函数覆盖率测试解决方案
  3. 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合
  4. java之远程接口调用
  5. [LintCode] Continuous Subarray Sum 连续子数组之和
  6. AC日记——导弹拦截 洛谷 P1020 (dp+模拟)
  7. COGS8 备用交换机
  8. 08重编终极版《东邪西毒:终极版》DVD粤语中字
  9. ISO7816通讯协议在工控主板EM9160中的实现方案
  10. About Health Monitor Checks
  11. 使用c#解析json库
  12. linux source命令与export命令的区别
  13. python重新利用shodan API
  14. 报错Domain=NSCocoaErrorDomain Code=3840 &quot;Garbage at end.&quot;
  15. linux的基本操作(shell 脚本的基础知识)
  16. 使用zabbix3.0.4的ICMP Ping模版实现对客户端网络状态的监控
  17. es6 Set 结合 Array.from 用法
  18. python发送邮件脚本ssl 465端口
  19. Entity Framework 与 LINQ to SQL
  20. 5分钟实现集群-NTP时间同步

热门文章

  1. Firefox使用Poster插件发送post请求
  2. Java基础系列--Executor框架(一)
  3. 【COOKIE 与 SESSION】
  4. Linux下查找大文件以及目录
  5. [DeeplearningAI笔记]ML strategy_2_1误差分析
  6. 接口中定义变量必须为public static final的原因
  7. 18_Python列表常用方法总结
  8. Oracle中的游标
  9. Halcon一日一练:图像、变量实时更新
  10. ZOJ 2314 Reactor Cooling [无源汇上下界网络流]