您的位置:首页 > 运维架构 > 网站架构

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半天还不成功的方便多了吧?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: