.exe 文件 apache 出现 403 错误
我有一个在 centos 环境上运行的 apache 网络服务器。有一个文件夹,其中有一个扩展名为 .exe 的文件
,当我尝试使用 http://mysite.com/folder/x.exe 我收到 403 错误。
但如果我将 gif 添加到该文件夹,它就可以 http://mysite.com/folder/pic.gif< /a>
我没有 SSH 访问此服务器的权限,但需要知道为什么会发生这种情况,文件权限也正确。
任何帮助表示赞赏
I have an apache webserver running on centos environment. There is a folder and in that there is a file which has an extension .exe lets name the file x.exe
when I try download this file using http://mysite.com/folder/x.exe I get a 403 error.
but if I add a gif to that folder it works http://mysite.com/folder/pic.gif
I dont have SSH access to this server but need to know some clue for why this is happenning, the file permissions are correct too.
any help is appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Apache 的 httpd.conf 中,可以为某些文件类型或路径指定默认处理操作。您的服务器可能被配置为阻止所有可执行文件。类似的阻塞也可能发生在
.htaccess
文件中。有几种方法可以做到这一点...这是一种:这个小片段可以位于主
.conf
文件中,并包含.conf
文件,或者>.htaccess
文件(或全部三个!),这只是一种可能性。最好的办法是检查服务器日志。他们将以类似于以下的形式指出给定请求被拒绝的原因:查看此文档以获取有关服务器的信息日志(包括日志本身的默认路径)。
正如我所提到的,还有一些其他方法可以阻止对某些文件类型、某些文件、某些文件夹等的访问。如果不查看错误日志,就很难确定原因。此外,如果没有对服务器的完全访问权限,可能无法改变此行为。这种阻止可能是您的网络主机的政策问题。
Within Apache's
httpd.conf
, it is possible to specify default handling actions for certain file types or paths. It may be that your server is configured to block executable files all together. Similar blocking can also occur in an.htaccess
file. There are a few ways to do it... here's one:That little snippet could be in the main
.conf
file, and included.conf
file, OR an.htaccess
file (or all three!), and again, that is just one possibility. Your best bet is to check out the server logs. They will indicate why a given request was denied in a form similar to this:Take a look at this document for information about server logs (including default paths to the logs themselves).
As I mentioned, there are a few other ways to block access to certain file types, certain files, certain folders, etc. Without looking at the error logs, it is very difficult to determine the cause. Further, without full access to the server, it may not be possible to alter this behavior. This blockage could be in place as a matter of policy for your web host.
我想补充一点,我花了大约 2 个小时一遍又一遍地尝试这个废话,结果发现 selinux 拒绝了 httpd 的特定文件类型。
尝试:
setenforce Permissive
并查看是否可以纠正错误
标签
软呢帽 16
I'd like to add I spent like 2 hours trying this crap over and over again only to discover that selinux was denying specific file types for httpd.
try:
setenforce Permissive
and see if that corrects the error
tag
Fedora 16
好吧,答案是我把它放在一个文件夹中,它禁止
在其中添加 exe 并且工作正常,
还有一个注释,这是在 SilverStripe CMS 支持的站点中,并且在 SilverStripe 的资产文件夹中
well the answer was I had this in a folder where it forbids the exe
added exe there and worked fine,
also a note, this was in a SilverStripe CMS powered site, and in the assets folder of SilverStripe