Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess:此处不允许订单_.htaccess_Apache2 - Fatal编程技术网

.htaccess:此处不允许订单

.htaccess:此处不允许订单,.htaccess,apache2,.htaccess,Apache2,我正在尝试在apache2中设置访问我的文档根目录的身份验证。。。 这是我的配置文件 <VirtualHost *:80> ServerAdmin webmaster@localhost AccessFileName .htaccess DocumentRoot /home/user/workspace <Directory /> Options FollowSymLinks

我正在尝试在apache2中设置访问我的文档根目录的身份验证。。。 这是我的配置文件

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        AccessFileName .htaccess
        DocumentRoot /home/user/workspace
        <Directory />
                Options FollowSymLinks
                AllowOverride None.htaccess
        </Directory>
        <Directory /home/vishu/workspace>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride AuthConfig
                Order allow,deny
                allow from all
        </Directory>
......
......

</VirtualHost>

服务器管理员webmaster@localhost
AccessFileName.htaccess
文档根/主/用户/工作区
选项如下符号链接
AllowOverride None.htaccess
选项索引跟随符号链接多视图
AllowOverride AuthConfig
命令允许,拒绝
通融
......
......
以下是/home/user/workspace文件夹中的.htaccess文件:

<FilesMatch >
.....
</FilesMatch>

    AuthType Basic
    AuthName "MY ZONE"
    #AuthBasicProvider file
    AuthUserFile /home/vishu/workspace/passwordfile
    AuthGroupFile /dev/null
    Require valid-user
.....
...

.....
AuthType Basic
AuthName“我的区域”
#AuthBasicProvider文件
AuthUserFile/home/vishu/workspace/passwordfile
AuthGroupFile/dev/null
需要有效用户
.....
...

Apache给出了
.htaccess:order not allowed here
错误,我从浏览器中收到了500个错误。

我不确定为什么您会收到“order not allowed here”,因为您的htaccess文件中没有
order
指令,但我猜它可能在您的
/
目录中,因为您已将override设置为
None

您可以尝试在
容器中添加覆盖,例如:

AllowOverride Limit

根据

我也遇到了同样的问题,这是由于主机上的限制,不允许我添加任何带有“订单允许、拒绝”或其他内容的内容。所以基本上我必须把所有不被允许的东西都注释掉,才能让它发挥作用


如果这对您来说是个问题,您可能希望切换主机

看看您的
AllowOverride
指令。我也有这个问题,但以下配置对我来说是可行的:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride AuthConfig Limit
    Require all granted
</Directory>

选项索引跟随符号链接
AllowOverride授权配置限制
要求所有授权
AllowOverride All
也可能有效,这取决于您希望允许的数量

有关更多信息,请查看以下两个链接:


我的问题是这里不允许使用
Require
,我没有意识到
AuthConfig
是您需要添加到
AllowOverride
的设置,如果您希望
.htaccess
文件能够添加
Require
指令。