apache 访问出现403 Forbidden
2015-03-10 13:35
519 查看
apache安装完成之后希望通过虚拟机来实现部署多个服务。在配置文件httpd.conf中,把”Include conf/extra/httpd-vhosts.conf”这句前面的注释去掉,引用httpd-vhosts.conf配置文件。
然后再打开conf/extra/httpd-vhosts.conf,注释其中配置。自己手动写一个
<VirtualHost *:80> DocumentRoot D:/moban157 ServerName www.a.com <Directory "D:/moban157"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>
写完之后通过命令检查下配置文件编写是否有错误:apachectl -t如果显示“Syntax OK”,说明配置文件没有问题,重启服务器:apachectl restart重启之后显示:
然后再打开conf/extra/httpd-vhosts.conf,注释其中配置。自己手动写一个
<VirtualHost *:80> DocumentRoot D:/moban157 ServerName www.a.com <Directory "D:/moban157"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>
写完之后通过命令检查下配置文件编写是否有错误:apachectl -t如果显示“Syntax OK”,说明配置文件没有问题,重启服务器:apachectl restart重启之后显示:
Forbidden You don't have permission to access / on this server.
发现访问有问题,查看配置文件,发现httpd-vhosts.conf中并没有限制访问的问题。于是查看apache的主配置文件,找到了以下限制访问的内容: 以上内容限制用户访问系统根目录,这应该是apache的默认安全设置,但是也限制了我们的设置目录地址,于是将上述内容修改成: 再次访问就没问题了!为了这个问题真可谓是让我大费周折了好几个小时,,说多了都是泪,记下来,以防备用
相关文章推荐
- Apache访问index.html总是出现403 Forbidden错误的解决方案
- apache 访问出现403 Forbidden
- 阿里云服务器公网ip访问Apache服务器出现403 Forbidden
- Apache访问index.html总是出现403 Forbidden错误的解决方案
- apache开启虚拟主机VHOST后 localhost无法访问,出现Forbidden 403
- apache 访问出现403 Forbidden
- apache服务出现Forbidden 403问题的解决方法总结
- Mac启动Apache之后访问localhost提示403 Forbidden
- Tomcat7/8访问Server Status、Manager App、Host Manager出现403 forbidden
- 重点:访问Nginx出现状态码为403 forbidden原因及故障模拟
- Wamp2.5(Apache2.4.9)外网访问403(Forbidden)错误
- Okhttp+Retrofit下访问百度音乐api出现403 forbidden的解决方案
- Centos下Apache使用Symlink访问外部目录出现403
- wamp安装后,apache访问出现403
- Okhttp+Retrofit下访问百度音乐api出现403 forbidden的解决方案
- Android Apache HttpClient 请求访问返回403 forbidden
- wamp2.5 更换默认web目录后访问localhost出现403 forbidden的解决办法
- 启动 apache2.4 出现 invalid command order 问题 【由于 PHP 访问权限 403 问题引起】
- apache2.2的大量虚拟主机配置出现403 Forbidden
- apache服务出现Forbidden 403问题的解决方法总结