服务器无法读取htaccess文件,拒绝访问是安全的 [英] Server unable to read htaccess file, denying access to be safe

查看:1069
本文介绍了服务器无法读取htaccess文件,拒绝访问是安全的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用AngularJS创建了一个简单的应用程序。当我尝试在我的网站 http://demo.gaurabdahal.com/recipefinder 中托管该项目时,它会显示以下错误:

I have created a simple app using AngularJS. When I tried to host that project in my website http://demo.gaurabdahal.com/recipefinder it shows the following error:


禁止使用

您没有访问此服务器上的/ recipefinder的权限。
服务器无法读取htaccess文件,拒绝访问是安全的

You don't have permission to access /recipefinder on this server. Server unable to read htaccess file, denying access to be safe

但是如果我转到 http://demo.gaurabdahal.com/ 它按预期显示了我已打印的访问被拒绝消息。但是,为什么无法打开AngularJS项目 recipefinder。如果我尝试在其中放置一个简单的HTML应用程序,它将打开就很好。

But if I go to http://demo.gaurabdahal.com/ it displays "access denied" message as expected, that I have printed. But why is it unable to open that AngularJS projects "recipefinder". If I tried to put a simple HTML app there, it opens just fine.

当我将其托管在github中时,同一个AngularJS项目也可以正常工作( http://gaurabdahal.github.io/recipefinder

The same AngularJS project works fine when I host that in github (http://gaurabdahal.github.io/recipefinder)

我可以

推荐答案

我也遇到了这个问题。我的建议是查看服务器错误日志文件。对我来说,该项目的顶层目录不可读。错误日志清楚地表明了这一点。一个简单的

I had this problem too. My advice is look in your server error log file. For me, it was that the top directory for the project was not readable. The error log clearly stated this. A simple

sudo chmod -R 755 <site_top_folder>

为我修复了它。

这篇关于服务器无法读取htaccess文件,拒绝访问是安全的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆