.htaccess错误:无效命令';AuthGroupFile';


.htaccess Error : Invalid command 'AuthGroupFile'

在此之前,我在windows上工作,我的项目运行正常。最近我搬到了ubuntu,我正在尝试LAMP上的安装项目。

我已经为此创建了主机(我直接通过localhost运行windows),当我运行它时,会得到500 Internal server Error

当我查看日志文件时,我得到了Invalid command 'AuthGroupFile', perhaps misspelled or defined by a module not included in the server configuration

.htaccess文件

  #php_value zend.ze1_compatibility_mode off
  AuthName "Restricted Area" 
  AuthType Basic 
  AuthUserFile /opt/lampp/htdocs/uniplex_mobile/.htpasswd 
  AuthGroupFile /dev/null 
  <Files manageurls.html>
  require valid-user
  </Files>
  <Files addurl.html>
  require valid-user
  </Files>
  <Files editurl.html>
  require valid-user
  </Files>
  AddType application/x-httpd-php .php .htm .html

我的项目是基于smarty框架的。

有人能帮忙解决这个问题吗?

提前感谢

你可以试试这个。

a2enmod authz_groupfile

假设您使用的是apache2.2,这意味着您缺少mod_authz_groupfile模块。

您需要在服务器配置中查找包含以下内容的行:

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so 

或者类似的东西,并确保它被评论掉。

否则,只需省略AuthGroupFile指令,它看起来无论如何都不会使用它。