apache 2.4-X版本配置虚拟主机
2017-03-22 17:49
405 查看
升级到apache2.4以上的版本时,其配置和之前的略有不同。
比如 ,配置虚拟主机的过程:
1.httpd.conf 文件开启虚拟主机配置文件加载
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.在extra/httpd-vhosts.conf配置文件中配置虚拟主机
#www目录下的虚拟主机
<VirtualHost *:80>
DocumentRoot "D:\wamp\wamp\www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Users\Administrator\Desktop\testgit"
ServerName www.testcrm.com
</VirtualHost>
3.此时,如果访问第二个虚拟主机是没有权限的。因为在httpd.conf中已禁用了其它目录的访问权限,此时只需在httpd.conf中找到
<Directory />
AllowOverride none
Require all denied #改为granted即可
</Directory>
更多的配置详情:http://httpd.apache.org/docs/
比如 ,配置虚拟主机的过程:
1.httpd.conf 文件开启虚拟主机配置文件加载
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2.在extra/httpd-vhosts.conf配置文件中配置虚拟主机
#www目录下的虚拟主机
<VirtualHost *:80>
DocumentRoot "D:\wamp\wamp\www"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Users\Administrator\Desktop\testgit"
ServerName www.testcrm.com
</VirtualHost>
3.此时,如果访问第二个虚拟主机是没有权限的。因为在httpd.conf中已禁用了其它目录的访问权限,此时只需在httpd.conf中找到
<Directory />
AllowOverride none
Require all denied #改为granted即可
</Directory>
更多的配置详情:http://httpd.apache.org/docs/
相关文章推荐
- Apache2.4 配置虚拟主机
- apache2.4配置虚拟主机随记
- apache2.4配置虚拟主机
- Apache2.4版本环境下基于虚拟主机、ssl、用户控制
- Apache2.4虚拟主机+别名配置
- 【CentOS】Apache多虚拟主机多版本PHP(5.3+5.6+N)共存运行配置全过程
- Ubuntu Server 14.04 & Apache2.4 虚拟主机、模块重写、隐藏入口文件配置
- debian配置apache2.4配置虚拟主机遇到的问题
- Apache2.4虚拟主机和多站点配置
- apache2.4 虚拟主机配置
- apache2.4版本服务器在本机上配置虚拟站点
- Apache多虚拟主机多版本PHP(5.2+5.3+5.4)共存运行配置全过程
- Apache2.4 配置虚拟主机和别名
- Apache多虚拟主机多版本PHP(5.2+5.3+5.4)共存运行配置全过程
- apache 2.0 版本 虚拟主机 与 虚拟目录配置
- php 多虚拟主机配置(apache2.2+2.4)
- Apache 2.2版本配置虚拟目录以及虚拟主机实例
- apache2.4配置虚拟主机遇到的那些坑
- 配置Apache2.4版本虚拟目录
- apache2.4配置虚拟主机