windows apache2.4 基于主机名的虚拟主机配置
2016-05-15 13:23
330 查看
配置虚拟主机之前,我们先配置俩个本地域名,打开在C:\Windows\System32\drivers\etc\hosts,添加俩个域名,同ip不同域名
新建俩个目录,作为apache服务的根目录
在httpd.conf的目录下,新建一个配置文件virtualhost-host.conf,添加虚拟主机配置
最后将virtualhost-host.conf导入到httpd.conf里面
启动服务,在浏览器上输入www.liuxg1.com和www.liuxg2.com便可以看到效果
新建俩个目录,作为apache服务的根目录
在httpd.conf的目录下,新建一个配置文件virtualhost-host.conf,添加虚拟主机配置
<VirtualHost *:80> DocumentRoot "E:\liuxg\liuxg1" ServerName www.liuxg1.com <Directory "E:\liuxg\liuxg1"> Options Indexes FollowSymLinks <!-- 若目录下有index则自动打开index文件,如果没有则列出文件列表 --> AllowOverride None Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "E:\liuxg\liuxg2" ServerName www.liuxg2.com <Directory "E:\liuxg\liuxg2"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> </VirtualHost>
最后将virtualhost-host.conf导入到httpd.conf里面
include conf\virtualhost-host.conf
启动服务,在浏览器上输入www.liuxg1.com和www.liuxg2.com便可以看到效果
相关文章推荐
- Apache日志分割脚本
- 解决apache日志产生"internal dummy connection"方法
- apache安装(适用于初学者)
- Spark-再次分析Apache访问日志
- 利用Apache Ant编译Hadoop2.6.0-eclipse-plugin
- Apache Flink源码解析之stream-transformation
- Web性能压力测试工具之ApacheBench(ab)详解
- apache-hama集群配置
- mac上安装Apache服务器
- Apache安装
- LR监控Apache性能
- Apache 配置使用小结
- Apache下error.log文件太大的处理
- ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
- Apache Spark 1.5新特性介绍
- 使用百度云加速防apache的ab测试
- 使用百度云加速防apache的ab测试
- 使用百度云加速防apache的ab测试
- windows下 php、apache 版本选择 解惑说明
- 阿里云ubuntu12.04环境下配置Apache+PHP+PHPmyadmin+MySQL