此处不允许使用AuthType

时间:2017-06-05 00:05:24

标签: apache .htaccess

我的.htaccess文件去年正在运行,据我所知,我没有改变它。但是,我现在收到以下错误:

AuthType not allowed here

我的.htaccess文件如下所示:

AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /pwd/.htpasswd
Require valid-user

如果它有助于我的主域名apache .conf文件如下所示:

<VirtualHost *:80>
  ServerAdmin webmaster@example.com
  ServerName subdomain.example.com

  DirectoryIndex index.html index.php
  DocumentRoot /var/sites/example.com/subdomain

  LogLevel warn
  ErrorLog /var/sites/example.com/log/error.log
  CustomLog /var/sites/example.com/log/access.log combined
</VirtualHost>

任何想法可能是什么问题?

1 个答案:

答案 0 :(得分:0)

recvfrom(以及其他指令)不被允许&#34;在这里&#34;几乎肯定是缺少AuthType允许AllowOverride文件覆盖指令。

https://httpd.apache.org/docs/current/mod/core.html#allowoverride

.htaccess仅适用于AllowOverride部分。解决方案可能如下所示:

<Directory>

只允许在<Directory "/var/sites/example.com/subdomain"> AllowOverride All </Directory> 目录中覆盖.htaccess

/var/sites/example.com/subdomain指令已存在,您可能希望修改它而不是添加新指令。此搜索有助于在大多数Linux系统上找到它:

<Directory>
相关问题