一、开启虚拟主机:

  在apache的配置文件httpd.conf中将Include conf/extra/httpd-vhosts.conf这行打开。

二、配置虚拟主机:

  在extra/httpd-vhosts.conf中添加如下代码

  

 <VirtualHost *:80>
DocumentRoot "F:/wamp/www/azw_for_thinkphp"
ServerName local.xyb.com
DirectoryIndex index.shtml index.html index.htm index.php
<Directory "F:/wamp/www/azw_for_thinkphp">
#Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

三、注释掉httpd.conf中的  DocumentRoot:''

四、将ip地址与虚拟域名关联起来

  在c:/Windons/System32/drivers/etc/hosts文件的末尾添加一行

  127.0.0.1       local.xyb.com

apeche配置虚拟主机的更多相关文章

  1. 使用WampServer环境,如何配置虚拟主机域名

    很多人不会配置虚拟主机,我这里简单交一下大家,分三步: 1.在 C:\Windows\System32\drivers\etc 文件夹中的文件 Hosts 文件修改代码为: 127.0.0.1 loc ...

  2. CentOS 7 配置虚拟主机站点

    1.进入/etc/httpd/conf 下 将httpd.conf 打开. 2.将DocumentRoot注释掉.(将ServerName 打开要不会有错误警告). 3.将虚拟主机站点配置包含进来:I ...

  3. 【转】Apache 配置虚拟主机三种方式

    Apache 配置虚拟主机三种方式  原文博客http://www.cnblogs.com/hi-bazinga/archive/2012/04/23/2466605.html 一.基于IP 1. 假 ...

  4. Wampserver2.5配置虚拟主机出现403 Forbidden的处理方案

    WampServer是一款由法国人开发的Apache Web服务器.PHP解释器以 及MySQL数据库的整合软件包.免去了开发人员将时间花费在繁琐的配置环境过程,从而腾出更多精力去做开发.在windo ...

  5. apache配置虚拟主机

    步骤如下: 1.在配置文件httpd.conf中启用httpd-vhosts.conf 找到# Virtual hosts将Include conf/extra/httpd-vhosts.conf前的 ...

  6. Wampserver2.5配置虚拟主机出现403 Forbidden解决办法

    一直在用APMServ5.2.6,mysql好办,可以用mariadb代替进行升级,但php升级到5.4.7就没办法再升级,安装加速器也困难.就想迁移到Wampserver上来,以前也尝试过Wamps ...

  7. nginx 配置虚拟主机

    文章转载自:http://www.ttlsa.com/html/1571.html 上篇说道我们的nginx是安装在/usr/local/nginx/ cd conf 我们现在把所有的虚拟主机放在一个 ...

  8. linux环境下配置虚拟主机域名

    linux环境下面配置虚拟主机域名 第一步:在root目录下面(即根目录)ls(查看文件)cd进入etc目录find hosts文件vi hosts 打开hosts文件并进行编辑在打开的文件最下面添加 ...

  9. apache配置虚拟主机后,启动速度慢

    apache配置虚拟主机后,启动速度慢且提示“the requested operation has failed” 可以通过在cmd下启动,来查找问题(命令中的“apache2.2”,是服务名,根据 ...

随机推荐

  1. Android(java方法)上实现mp4的分割和拼接 (一)

       最近正在处理android上的mp4切割问题.学习了很多mp4的知识,mp4文件按照编码类型,分为mpeg-4,avc这两种:这两种类型的mp4在后面的处理中会有不同的地方. 在Android系 ...

  2. Go -- socket read的内容以16进制输出

    buf := make([]) reqLen, err := conn.Read(buf) // 遍历, 转为16进制 buffer := new(bytes.Buffer) for _, b := ...

  3. Activity的启动模式全解standard,singleTop,singleTask,singleInstance

    在android中控制Activity的启动模式的属性主要控制两大功能: 1,控制activity 进入哪一个任务task 中,   有两种可能,进入启动task中,进入指定taskAffinity的 ...

  4. Zen of Python(Python的19条哲学)

    The Zen of Python Beautiful is better than ugly. Explicit is better than implicit. Simple is better ...

  5. mysql select last_insert_id()函数返回的值

    mysql)); 创建表j 插入数据 mysql> insert into j(name) values('wanggiqpg'); Query OK, row affected (0.00 s ...

  6. MQTT 测试工具介绍

    eclipse paho 下载地址为: https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org ...

  7. windows下taskkill命令简介

    1.简介 使用该工具可以按照进程 ID (PID) 或映像名称终止任务. 2.语法 TASKKILL [/S system [/U username [/P [password]]]]        ...

  8. Git bare repo with multiple branches

    http://stackoverflow.com/questions/9324762/git-bare-repo-with-multiple-branches Q: I want to make a ...

  9. response响应和User-Agent历史

    返回百度的源码,没有任何伪装: response是服务器响应的类文件,除了支持文件操作的方法以外,还支持以下方法:

  10. python缺省参数

    def test(a,b=22): result=a+b print("resuLt=%d"%result) test(33,33) #缺省参数的意思就是,函数在有参数的情况下,调 ...