Working with Dynamic Configuration Files
• RequireAuth dbm= dbmfile userfile= database_name
• RestrictAccess method=HTTP-method type=allow|deny
Example of an .nsconfig File
The following example shows an .nsconfig file:
<Files *
ErrorFile reason="Unauthorized" code="401" path="/errors/unauthorized.html"
ErrorFile reason="Forbidden" code="403" path="/errors/forbidden.html"
ErrorFile reason="Not Found" code="404" path="/errors/notfound.html"
ErrorFile reason="Server Error" code="500" path="/errors/server-error.html"
RestrictAccess method="(GET|HEAD|POST)" type="allow" ip="*"
RestrictAccess method="(GET|HEAD|POST)" type="deny" ip="198.95.251.30" return-code="404"
</Files
<Files *.gif
AddType exp=*.gif type=application/octet-stream
</Files
<Files *.txt
RequireAuth dbm=" server_root /authdb/default" realm=Text userpat="user*"
</Files
178 Netscape Enterprise Server Administrator's Guide
realm= string userpat= PATTERN
RequireAuth lets you ask the user for a username and a password when
accessing the directory. dbm is a user database. Note that dbm can only be
used on a 2.x Enterprise user database. userfile is an NCSA-style user
database filename. The file consists of lines in the format
user:encrypted_password . realm is a unique string to tell your
users which password they should use. userpat determines which users
from the given dbm or userfile are allowed access. userpat is a
wildcard pattern or list of user names. For example, you can use the syntax
userpat="user1" or userpat="(user1|user2)" for specifying a
user or a list of users.
ip=addrpattern dns=hostpattern return-code=403|404
RestrictAccess applies access control to the directory and restricts
certain users. method is an optional parameter specifying a wildcard
pattern of HTTP methods to protect (no method specified means all of
them). type determines whether the IP address wildcard pattern or
hostname wildcard pattern is allowed or denied access. If the only
RestrictAccess directives in a Files set are of type allow, then all
hosts not specified by the patterns are denied. ip must be typed in
lowercase for the directive to work. More than one RestrictAccess can
appear in the file. The order in which these lines appear is important; later
RestrictAccess lines override earlier ones.
Need help?
Do you have a question about the Netscape Enterprise Server and is the answer not in the manual?
Questions and answers