1.先找到apache的配置文件 httpd.conf 找如如下代码:

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

把# Include conf/extra/httpd-vhosts.conf 去掉#号,如下:

Include conf/extra/httpd-vhosts.conf

保存。

2.打开 Apache 的 conf 目录下的  extra 文件夹下的  httpd-vhosts.conf 文件,用记事本打开,在末尾加入以下代码:

 <VirtualHost *:80>
ServerName www.mydemo.com
DocumentRoot "D:/mydemo"
<Directory "D:/mydemo">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride Options FileInfo
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

3.再到C:->Windows->System32->drivers->etc目录,打开hosts文件。
在末尾添加如下代码:

127.0.0.1 www.mydemo.com

然后再创建D:\mydemo目录
再然后重启一下apache服务器。
在浏览器输入www.mydemo.com看看

php 在windows下配置虚拟目录的方法的更多相关文章

  1. Tomcat 中如何给 web 项目配置虚拟目录的方法

    为什么要给 web 项目配置虚拟目录? 初学 JavaWeb 时,会发现只要我们把 web 项目放到 Tomcat 的 webapps 目录下,再通过 http://localhost:8080/项目 ...

  2. SpringMVC第五篇【方法返回值、数据回显、idea下配置虚拟目录、文件上传】

    Controller方法返回值 Controller方法的返回值其实就几种类型,我们来总结一下-. void String ModelAndView redirect重定向 forward转发 数据回 ...

  3. Windows下配置g++的简单方法

    需要下载名为 Cygnus的软件.下载地址: http://www.claremontmckenna.edu/math/ALee/g++/full.exe 安装完成后配好环境变量就可以用gcc, g+ ...

  4. wampserver下配置虚拟主机 实现多站点支持

    wampserver下配置虚拟主机 实现多站点支持 wampserver是由德国人开发,在windows环境下实现apache+php+mysql的一款集成环境软件,wampserver自带SQLit ...

  5. windows 下配置 Nginx 常见问题(转)

    windows 下配置 Nginx 常见问题 因为最近的项目需要用到负载均衡,不用考虑,当然用大名鼎鼎的Nginx啦.至于Nginx的介绍,这里就不多说了,直接进入主题如何在Windows下配置. 我 ...

  6. 解决 Tomcat 无法绑定 80 端口的问题,以及 Tomcat 配置虚拟目录、二级域名等

    问题 今天安装完 Tomcat,安装时把 Tomcat 默认的 HTTP/1.1 Connector Port 从 8080 改为了 7080,启动 Tomcat,在浏览器中输入 Http://loc ...

  7. PHP学习笔记:APACHE配置虚拟目录、一个站点使用多域名配置方式

    我用的是xmapp lite2016的集成包,配置虚拟目录教程如下: 找到httpd-vhosts.conf这个文件,这个文件一般是在xampp\apache\conf\extra这个路径下面,找不到 ...

  8. Apache配置虚拟目录和多主机头

    呃,相当古老的话题了,不过网上的资料实在是太坑爹,无奈只能自己动手做个备忘了...这里不提虚拟目录和主机头的区别了,不懂得童鞋去面壁思过吧 多个虚拟目录 首先把Apache安装到D:\Program ...

  9. windows下配置wnmp

    最近尝试windows下配置nginx+php+mysql,在这里总结一下. 1.下载windows版本的nginx,官网​下载地址:http://nginx.org/en/download.htm, ...

随机推荐

  1. 链队列的C++实现

    #include<iostream> using namespace std; //节点类 template<class T> struct QNode { T data; Q ...

  2. CCEaseElasticOut调整速度和振幅

    pSprite->setAnchorPoint(CCPoint(,)); pSprite->setPosition(CCPoint(,)); CCFiniteTimeAction* pAc ...

  3. 服务器搭建1 安装mysql数据库

    一,安装mysql-service (1)检查系统中是否已经安装mysql 在终端里面输入 sudo netstat -tap | grep mysql 若没有反映,没有显示已安装结果,则没有安装.若 ...

  4. 新浪微博5s钟后跳转页面

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  5. 深入理解Eureka - Eureka Client获取注册信息机制

    深入理解Eureka - Eureka Client获取注册信息机 Eureka Client提供了定时获取注册信息的机制.Eureka Client获取注册信息的所有逻辑都在DiscoveryCli ...

  6. CEdit 控制键盘操作

    写在前面的话:在工作中要实现这样一个功能,在一个树形控件中选择要发送消息的客户,添加到一个列表控件中,点击确定跳到一个信息发送页面如下图,在发送人编辑框中显示选择的客户,要实现的就是即允许用户删除用户 ...

  7. hive12启动报错org.apache.thrift.server.TThreadPoolServer.<init>(Lorg/apache/thrift/server/TThreadPoolServer$Args;)

    执行如下命令启动hive服务:./bin/hive --service hiveserver,报如下错误: Starting Hive Thrift ServerException in thread ...

  8. [uboot]What is MLO file?

    转自:https://coherentmusings.wordpress.com/2012/09/05/what-is-mlo-file/ I have had the Beagle-xM for a ...

  9. 数据库——IN、ANY、SOME 和 ALL 操作符的使用

    sql中all,any,some用法 简介: --All:对所有数据都满足条件,整个条件才成立,例如:5大于所有返回的id select * from #A where 5>All(select ...

  10. C++实现 找出10000以内的完数

    C++实现 找出10000以内的完数 #include <stdio.h> int main(){ int n; // 用户输入的整数 int i; // 循环标志 printf(&quo ...