xampp下创建多个虚拟网站目录
2016-03-04 10:38
561 查看
大家知道,伟大的IIS下面增加多个网站就1分钟搞定。现在换XAMPP下运行多个PHP目录,那我们需要有点探索精神。那么进入正题
首先,下载安装官方最新版本的xampp,地址:点击。记得如果电脑安装有IIS,记得点击config来修改端口号
安装成功后,运行软件,点击Explorer.
会打开软件的安装目录,选择.\apache\conf\extra\httpd-vhosts.conf ,打开。
添加如下内容:
[html] view plain copy print?
<VirtualHost 127.0.0.2:80>
ServerAdmin "127.0.0.2:80"
DocumentRoot "E:/wwwroot/xxx"
ServerName 127.0.0.2
ErrorLog "logs/xxx.log"
CustomLog "logs/xxx.log" combined
</VirtualHost>
DocumentRoot "E:/wwwroot"
<Directory "E:/wwwroot">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
,之后依次添加127.0.0.3,127.0.0.4,就直接复制
比网上那些改HOST半天还不成功的方便多了吧?
首先,下载安装官方最新版本的xampp,地址:点击。记得如果电脑安装有IIS,记得点击config来修改端口号
安装成功后,运行软件,点击Explorer.
会打开软件的安装目录,选择.\apache\conf\extra\httpd-vhosts.conf ,打开。
添加如下内容:
[html] view plain copy print?
<VirtualHost 127.0.0.2:80>
ServerAdmin "127.0.0.2:80"
DocumentRoot "E:/wwwroot/xxx"
ServerName 127.0.0.2
ErrorLog "logs/xxx.log"
CustomLog "logs/xxx.log" combined
</VirtualHost>
DocumentRoot "E:/wwwroot"
<Directory "E:/wwwroot">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
,之后依次添加127.0.0.3,127.0.0.4,就直接复制
比网上那些改HOST半天还不成功的方便多了吧?
相关文章推荐
- 如何让网站判断是手机客户端访问,如果是跳到手机版
- Solaris10 sparc架构下安装gdb和简单调试
- 理解RESTful架构(转)
- 《架构师成长之路》连载之NO.2
- 大型网站电商网站架构案例和技术架构的示例
- 大型网站架构不得不考虑的 10 个问题
- 浅谈Web网站架构演变过程及各阶段所用的技术和架构设计
- 让你的HTML5&CSS3网站在老IE中也能…
- Android应用开发架构
- 网站大流量解决
- 利用phpStudy 探针 提权网站服务器
- JAVA网站高并发解决方案
- Android学习网站,资料推荐,学习经验共享
- 提高PHP网站性能的经验总结
- 百度地图API 学习网站
- 珠海网站建设需要多少钱?
- 网站数据统计分析之日志收集原理及其实现
- 一个小网站的搬迁过程
- 亿级用户下的新浪微博平台架构
- 系统架构随记