Hence, SREhttp/2 offers a fairly simple implementation of the HTACCESS method. In particular, with SREhttp/2's HTACCESS, you can:
The easiest way to create a HTACCESS file is to use the HTACCESS configuratorBy default, the HTACCESS files are named .HTACCESS (note that there is nothing before the "."). If you are using a FAT drive, you can change this -- see the HTACCESS_FILE parameter in the SREH2INI.RXX program file.
To instruct SREhttp/2 to use HTACCESS files, you must set the HTACCESS parameter. Alternatively, you can enable (or disable) the use of HTACCESS on a selector specific basis.
Caution | If you use HTACCESS files, and required privileges to control access to a resource, make sure that you don't have contradictory requirements. That is, make sure that a client has a username and password recognized by the HTACCESS file, and client privileges that match the selector-specific required privileges. |
Note on caching | SRE2003's request caching will be diabled for all requests that might be subject to HTACCESS control -- that point to a file in a directory that contains an .HTACCESS file (or is a subdirectory of a directory that contains an .HTACCESS file). |
The following lists the parameters recognized in HTACCESS files.
Order is not important, parameters that do not apply to the authorization method specified
will be ignored.
A sample htaccess file illustrates the proper
file format.
Acceptable values are BASIC and IDENT. BASIC
actually means either BASIC or DIGEST authentication.
IDENT is the IDENT method (minimal support under SREhttp/2).
The entire remainder of the line will be considered the value of the Realm.
Special Note: the filename must contain a complete path and filename. (E.g. "d:\path\filename.ext")
The AuthUserFile is a text file, with each line containing a userid and a password, in
the format:
user:password
(Password is currently only supported in unencrypted form.)
Special Note: the filename must contain a complete path and filename. (E.g. "d:\path\filename.ext")
The AuthGroupFile is a text file, with each line containing a groupname and a list of users, in
the format:
group:user1 user2 user3 ...
Usernames must be defined in the AuthUserFile to have a password associated with it. Since the IDENT method does not employ passwords, the AuthUserFile is not necessary when using this method.
The next two parameters do not pertain to authorization:
For example, suppose that DEFAULTS=index.htm index.html". A request for "/foo/" will cause the system to attempt to return the file "/foo/index.htm", if it exists. Otherwise it will move to the next item in the list and try again. Using DefaultIndex allows one to specify an addition default name (e.g.sample.html) that will be used if none of these exist (but just for requests to this directory and its subdirectories)
Sample HTACCESS file |
AuthType basic AuthName Demo AuthUserList joe:exyi sue:a5teta AuthUserFile f:\www\Passwd.lst AuthGroupFile f:\www\groups.lst Require users John Harry me Tom Dick Others Redirect /srehttp2 http://srehttp2.srehttp.org Redirect /score/day1.htm http://sports.mysite.org/archive/oldnews.html DefaultIndex hello.shtml #IndexIgnore * #IndexIgnore * means suppress the DIR display (anything else, do NOT suppress) |