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

windwos 下 apache 配置多站点

2017-08-31 13:29 459 查看
apache版本:httpd-2.4.27-x64-vc14

官网下载编译后的即可

然后正常安装

1.host文件里面配置

127.0.0.1 www.aaa.com

127.0.0.1 www.bbb.com

127.0.0.1 www.ccc.com

2.修改配置文件 httpd.conf

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
#
# 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

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>


修改为

ServerName www.aaa.com:80
DocumentRoot "H:/ApacheWeb"
<Directory "H:/ApacheWeb">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

<VirtualHost www.bbb.com:80>
DocumentRoot "H:/ApacheWeb"
<Directory "H:/ApacheWeb">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>


我这里文件存放的路径就用了一个H:/ApacheWeb 大家可根据自己情况设置不同的项目所在路径,目录下存放一个index.html静态页

3.重启apache服务

4 访问 www.aaa.com 和 www.bbb.com 即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: