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

I have a previous post which demonstrates how to add HTTP Authentication by .htaccess.
.htaccess – Setting Password For Your Web Folder

But if it does not work and shown the following error in the Apache error log

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


 

You can fix it by turn on the authn_file module. For Debian Linux like Ubuntu,

  • a2enmod authn_file
  • /etc/init.d/apache2 restart

 

For Fedora, add the following line to /etc/httpd/conf/httpd.conf

  • LoadModule authn_file_module modules/mod_authn_file.so

Then restart the Apache

  • /etc/init.d/httpd restart

 

Done =)

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.