通过不同的域名来访问根目录和根目录下的子目录
来源:互联网 发布:女装淘宝首页 编辑:程序博客网 时间:2024/05/19 03:18
wampserver的根目录为www目录,子目录为www\aaa,通过域名www.111.com访问www目录,通过域名www.222.com访问www\aaa目录,操作步骤如下
1)左键右下角的wampserver图标,打开apache->httpd.cof,找到
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
保存退出。
2)配置vhost文件,打开wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf
在最后加上
<VirtualHost *:80>
ServerAdmin xxx@qq.com
DocumentRoot "F:/wt/wampServer/setUpDir/wamp/www"
ServerName www.111.com
ServerAlias www.111.example.com
ErrorLog "logs/111.example.com-error.log"
CustomLog "logs/111.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin xxx@qq.com
DocumentRoot "F:/wt/wampServer/setUpDir/wamp/www/aaa"
ServerName www.222.com
ServerAlias www.222.example.com
ErrorLog "logs/222.example.com-error.log"
CustomLog "logs/222.example.com-access.log" common
</VirtualHost>
保存退出
3)重启wampserver
4)修改hosts文件,做好域名映射
打开C:\Windows\System32\drivers\etc\hosts
在最后加上
192.168.1.16 www.111.com
192.168.1.16 www.222.com
保存退出
说明:上面192.168.1.16 是本机的ip,因为两个域名是没有在域名服务器上注册的,所以,只能在本机通过域名访问
- 通过不同的域名来访问根目录和根目录下的子目录
- linux 根目录下的子目录的意义
- linux下 /根目录下面的子目录介绍
- 计算机用户根目录下的子目录
- 根目录下的子目录和文件作用
- 查找域名的根目录
- Linux根目录下的sys文件夹下的子目录
- Linux根目录下的各个子目录的作用(精简)
- Linux 下 根目录对应的子目录的介绍
- Linux系统根目录下的子目录的作用
- 打印盘符根目录下的所有子目录
- Typecho安装在根目录下与子目录的区别
- apache 无法访问根目录下的子目录——(笔记)
- apache 无法访问根目录下的子目录——(笔记)
- linux根目录下各个子目录的作用(精简版)
- 根目录,子目录,当前目录的区别
- Jsp根目录的不同含义
- nginx服务器绑定域名和设置根目录的方法
- Android EGL_BAD_CONFIG error,配置EGLConfigChooser
- hdu2852 KiKi's K-Number 树状数组求第k大数
- windows下使用libxml2处理XML报文
- Hadoop 1.2.1升级2.6.0的一次崎岖之旅(包括Hive、HBase对应的升级)
- 蓝桥杯——安慰奶牛
- 通过不同的域名来访问根目录和根目录下的子目录
- hiho一下 第十五周
- 物联12:rfid与IC卡
- minicom配置及使用方法
- TCON控制字及TMOD寄存器
- HTTP请求(请求头、响应头)详解(一)
- Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-weba
- 准备篇:系统环境设置
- Yii2 缓存