Apache VirtualHost配置成功/Wamp虚拟主机配置 百度空间_应用平台
来源:互联网 发布:做个网络回路 编辑:程序博客网 时间:2024/05/21 07:05
今天在研究虚拟主机的配置,觉得这个很有意思,然后再自己的本地电脑做实验,在网上找了几个,终于配置成功了,说说我的配置方法。
1 编辑httpd.conf,查找Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
2 编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:/wamp/Apache2/conf/extra。
Order Allow,Deny
Allow from all
</Directory>
<Directory "d:/wamp/www/host2">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
4 修改C:/WINDOWS/system3/drivers/etc/host这个文件,用记事本打开,加上如下内容:
127.0.0.1 www.host1.com
127.0.0.1 www.host2.com
好了,然后重启apache,在浏览器里面输入www.host1.com,看看访问到的内容是不是host1这个目录呢。
1 编辑httpd.conf,查找Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
2 编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:/wamp/Apache2/conf/extra。
把里面的内容清空掉,换成下面的内容:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.host1.com
ServerAlias www.host1.com
DocumentRoot "D:/wamp/www/host1"
</VirtualHost>
<VirtualHost *:80>
ServerName www.host2.com
ServerAlias www.host2.com
DocumentRoot "D:/wamp/www/host2"
</VirtualHost>
3 编辑httpd.conf,找到DocumentRoot "d:/wamp/www/"这项,这是默认根目录路径,但是要更改的不是这个,一直往下找,找到<Directory "d:/wamp/www">,然后在该</Directoory>后加上如下内容:
<Directory "d:/wamp/www/host1">
Options Indexes FollowSymLinks
AllowOverride allOrder Allow,Deny
Allow from all
</Directory>
<Directory "d:/wamp/www/host2">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
4 修改C:/WINDOWS/system3/drivers/etc/host这个文件,用记事本打开,加上如下内容:
127.0.0.1 www.host1.com
127.0.0.1 www.host2.com
好了,然后重启apache,在浏览器里面输入www.host1.com,看看访问到的内容是不是host1这个目录呢。
- Apache VirtualHost配置成功/Wamp虚拟主机配置 百度空间_应用平台
- Apache VirtualHost配置成功/Wamp虚拟主机配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- Apache 虚拟主机 VirtualHost 配置
- ZZ: Apache 虚拟主机 VirtualHost 配置
- Linux配置Apache虚拟主机VirtualHost
- Windows下配置Apache虚拟主机(VirtualHost)
- [整理]框计算?云计算?
- Spring 类构造器创建Bean
- 收费系统体会(1) 一次纠结就是一次大的进步.
- OpenGL学习笔记 (1) —— 在VS2008下的两个简单例子
- InstallAnywhere 2009 Enterprise 安装及破解
- Apache VirtualHost配置成功/Wamp虚拟主机配置 百度空间_应用平台
- 一生何求
- MiscOnStarCraft2(b)
- svn合并时候的诡异事件
- 配对堆头文件C语言
- flnx 在 mini2440 qemu ecos的nano-x上运行起来了
- Oracle Data Guard 快速启动故障切换指南
- 创建进程
- 配对堆实现文件C语言