1.找到wamp安装目录的apache安装目录 找到 httpd.conf文件 例如我安装的目录为 E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf

也可以通过wamp图标打开。查找 Virtual hosts  去掉下面include行前面的# 修改为
#Virtual hosts
Include conf/extra/httpd-vhosts.conf
这样就在配置文件中引入了httpd-vhosts.conf文件。
2. 在目录 如E:\wamp\bin\apache\apache2.2.8\conf\extra 下面找到刚刚包含进来的文件:httpd-vhosts.conf
打开文件 在最后面添加配置文件
<VirtualHost *:80>
    ServerAdmin 995222133@qq.com
    DocumentRoot "E:/www"  
    ServerName   www.bzzxcs.com    
ServerAlias  www.bzzxcs.com
    ErrorLog "logs/www.bzzxcs.com -errlo.log"
    CustomLog "logs/ www.bzzxcs.com -access.log" common
    <directory "E:/www">
        Options FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from all
    </directory>
</VirtualHost>
其中 ServerAdmin、ErrorLog 、CustomLog为可选配置,也可以不对其进行配置。
3.打开系统文件目录:C:\WINDOWS\system32\drivers\etc  找到hosts文件。在最下面添加刚才配置的域名 使域名生效。如:
127.0.0.1       www.bzzxcs.com自己可以根据需要多配置几个
4.重启apache服务。就ok了。
注意事项:
配置好以后原来的localhost就不可以使用了
只要在E:\wamp\bin\apache\apache2.2.8\conf\extra\httpd-vhosts.conf上添加
<VirtualHost *:80>
    ServerAdmin 995222133@qq.com
    DocumentRoot "e:/wamp/www"  
    ServerName localhost   
ServerAlias localhost
    ErrorLog "logs/www.bzzxcs.com -errlo.log"
    CustomLog "logs/www.bzzxcs.com -access.log" common
    <directory "e:/wamp/www">
        Options FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from all
    </directory>
</VirtualHost>

然后在C:\WINDOWS\system32\drivers\etc\hosts 把 #127.0.0.1       localhost  注释去

最新文章

  1. Bookstore project using XAMPP 详细配置 Part 1
  2. 教你写一个web远程控制小工具
  3. css排版
  4. The Socket API, Part 4: Datagrams
  5. zedboard之GPIO驱动(从FPGA一直到LINUX应用)
  6. Django Admin后台使用tinymc 富文本编辑器
  7. Portal相关技术及架构
  8. c# 提取word文件中的图片问题
  9. 11g Rac 切换
  10. Linux Date命令学习笔记
  11. C库 - 常用文件IO函数
  12. Android查看stdout 和stderr
  13. JavaScript提高篇之预解释作用域以及this原理及其应用
  14. MongoDB 高可用集群副本集+分片搭建
  15. 1.2:Properties
  16. php归档格式:phar文件详解(创建、使用、解包还原提取)
  17. Ubuntu 16.04及以上 安装/卸载 Docker-CE
  18. bash:command not found解决方法
  19. js this详解,事件的三种绑定方式
  20. 20169207《Linux内核原理与分析》第六周作业

热门文章

  1. Mybatis实现数据的增删改查(CRUD)
  2. 给11gR2 Dataguard打psu补丁的步骤及注意事项
  3. 去掉移动端页面 input, textarea, button, a 标签获取焦点时显示的黑影
  4. JavaScript闭包深入解析
  5. oracle存储过程实现根据已有数据批量更新另一批数据
  6. div宽高设置为百分比
  7. iOS--关于同步下载
  8. js判断是iOS还是Android
  9. 进制转换( C++字符数组 )
  10. java分享第七天-03(递归打印文件目录的树状结构)