SHARE
Facebook X Pinterest WhatsApp

Securing Your Web Pages with Apache Page 12

Written By
thumbnail Ken Coar
Ken Coar
Jun 29, 2000
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



The htdigest and dbmmanage tools, also
in the /usr/local/web/apache/bin/ directory, are similar
to the htpasswd application. htdigest
allows you to maintain text database files for use with Digest
authentication, and dbmmanage supports the
DB, DBM, GDBM, and NDBM database formats. dbmmanage
is a Perl script, so you will need to have the Perl interpreter
(version 5 or later) installed on your system in order to use it.

Location of Your Authentication Database

Remember that one of the main things the Apache Web server does is
serve up files to visitors from the Internet — and don’t put your
authentication database files anyplace where that could happen to
them!

For server-wide database files (that is, those managed by the
Webmaster and listed in the httpd.conf file, rather
than in user’s .htaccess files), make sure you put them
someplace where they’re not under the DocumentRoot. Also
make sure you don’t put them someplace where they’re under
an Aliased or ScriptAliased directory.

For access control used by individual users to protect their own documents,
the database files should not be under the directory listed in
the UserDir directive in the server’s httpd.conf
file (typically public_html). Having your users
put their database files in their home directory, or in another
subdirectory (other than under public_html!) is
a good idea.

Recent versions of Apache (those newer than 1.3.4 or so) include
a default limitation on the common filenames used for per-directory
authentication databases:

  
    
        Order allow,deny
        Deny from all
    

This will prevent the server from processing requests for files named
.htpasswd, .htaccess,
.htpasswd-foo.db, and so on. Note that if you
upgraded your Apache server from an earlier version, your
httpd.conf file may not include these lines, and you
may want to add them yourself.

Frequently-Asked Apache Security Questions

thumbnail Ken Coar

Ken Coar is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.