關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • .htaccess – Invalid command ‘AuthUserFile’ 錯誤

    Posted on January 17th, 2012 Sam Tang No comments

    在主機上的 Apache 用 .htaccess 設定了密碼保目錄,但發覺升級 Apache 後就出現 Internal Server Error,再查看 apache 的 error log,發現以下的錯誤訊息:

    .htaccess: Invalid command ‘AuthUserFile’, perhaps misspelled or defined by a module not included in the server configuration

    解決方法只要開啟 httpd.conf 並開啟 authn_file module 便可以,打開 httpd.conf,找到 mod_authn_file 一行並將最開端的註釋符號刪除,改成:

    LoadModule authn_file_module modules/mod_authn_file.so

    然後重新啟動 apache 便完成了。


    Comments are closed.