阿帕奇 - 403禁止 [英] apache - 403 forbidden

查看:210
本文介绍了阿帕奇 - 403禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想我的文件上传到我的Ubuntu的服务器上的本地的Apache。我安装的Apache2,现在我得到403禁止所有的时间。

So I am trying to upload my files to a local apache on my Ubuntu Server. I installed apache2 and I am now getting 403 forbidden all the time.

我一直在寻找,寻找一些答案,为什么在计算器和其他地方,到目前为止,它已没有结果。

I have been searching and looking for some answers as to why on stackoverflow and elsewhere so far, it has yielded no results.

文件在/ etc / Apache2的是:apache2.conf(这是很大的),evvars,魔术,ports.conf和httpd.conf中(这一次是空的,里面没有)

Files in /etc/apache2 is: apache2.conf (this is big), evvars, magic, ports.conf and httpd.conf (this one was empty, nothing inside it).

此外,一旦我有固定的这个,有点离题,但我可以改变它,这样你就不必键入本地IP地址或本地主机,这样我可以键入类似mysite.local /的index.php?

Also once I have fixed this, a bit off-topic, but can I change it so that instead of typing the local ip-address or localhost so that I could type something like mysite.local/index.php?

推荐答案

如果我想比你的目录,你试图访问权是从网络accessable。

If I guess right than your directory you are trying to access are accessable from the web.

您需要一个 <名录及GT; 指令,让apache的访问该目录:

You need a <Directory> directive which allows the apache to access that directory:

<Directory /your/path>
  Order Deny,Allow
  Deny from All
</Directory> 

这是正常的的httpd.conf 是空的。这是德precated所以你不应该使用它。

It is normal that the httpd.conf is empty. It is deprecated so you should not use it.

如果您使用的Linux还需要检查你的Apache的用户可以访问该目录:结果
用户在通常定义的/ etc / apache2的/ envvars中文件中的行像出口APACHE_RUN_USER = www数据 。因此,如果apache的用户下运行 www数据目录应该是由用户accessable www数据或者更直接拥有该目录/文件。

If you use linux also check that the user of your apache can access that directory:
The user is normally defined in the /etc/apache2/envvars file in a line like export APACHE_RUN_USER=www-data. So if the apache runs under the user www-data the directory should be accessable by the user www-data or maybe better directly own that directory/files.

这篇关于阿帕奇 - 403禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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