别名403禁止与Apache [英] Alias 403 Forbidden with Apache

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

问题描述

我试图创建一个文件夹命名为week7和文档根目录以外的文件夹中一个名为hello.html的html页面,并将它通过Alias​​指令查看。

I'm trying to create a folder named week7 and an html page named hello.html in that folder outside the document root and have it viewed through an Alias directive.

我创建了一个文件夹中名为week7出来的文档根。
我选择了这个位置是:

I created a folder named week7 out of the Document Root. I chose this location for it:

/usr/local/www/week7

而我的文档根目录为:

while my document root is:

/usr/local/www/apache22/data

在httpd.conf,并在标签,我写道:

in httpd.conf and under tag, I wrote:

    Alias /week7 /usr/local/www/week7
<Directory /usr/local/www/week7>
    Require all granted
</Directory>

重新启动服务器后,我得到了以下信息:
故宫403消息。

After rebooting the server, I got the following message: Forbidden 403 message.

我试图改变权限hello.html的文件,
在week7文件夹,甚至www文件夹并没有什么改变。

I tried changing permissions for the hello.html file, the week7 folder and even the www folder and nothing changed.

任何想法?

推荐答案

如果你使用Apache 2.4

If you're using apache 2.4

令允许,拒绝出租车从所有允许

Order allow,deny
Allow from all

变得...

要求所有批准

<一个href=\"https://httpd.apache.org/docs/2.4/upgrading.html\">https://httpd.apache.org/docs/2.4/upgrading.html

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

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