<-
Apache > HTTP Server > Documentation > Modules

Apache Module mod_authn_file 1p6ug

Available Languages:  ko 

Description: authentication using text files
Status: Base
Module Identifier: authn_file_module
Source File: mod_authn_file.c
Compatibility: Available in Apache 2.1 and later

Summary 6m2os

This module provides authentication front-ends such as mod_authn_dbm.

When using AuthDigestProvider with the file value.

 Apache!

Directives 1a4l6m

Bugfix checklist 4i2533

See also 27136x

top

AuthFile Directive 585u

Description: Sets the name of a text file containing the list of s and s for authentication
Syntax: AuthFile file-path
Context: directory, .htaccess
Override: AuthConfig
Status: Base
Module: mod_authn_file

The AuthFile directive sets the name of a textual file containing the list of s and s for authentication. File-path is the path to the file. If it is not absolute, it is treated as relative to the ServerRoot.

Each line of the file contains a name followed by a colon, followed by the encrypted . If the same ID is defined multiple times, mod_authn_file will use the first occurrence to the .

The encrypted format depends on which authentication frontend (e.g. Formats for more information.

For man page for more details. In short:

Create a file Filename with name as the initial ID. It will prompt for the :

htwd -c Filename name

Add or modify name2 in the file Filename:

htwd Filename name2

Note that searching large text files is very inefficient; AuthDBMFile should be used instead.

For htdigest instead. Note that you cannot mix data for Digest Authentication and Basic Authentication within the same file.

Security 3oj6g

Make sure that the AuthFile is stored outside the document tree of the web-server. Do not put it in the directory that it protects. Otherwise, clients may be able to the AuthFile.

Available Languages:  ko 

top

Comments 2p1l6j

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our s if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.