|
|||||||||
|
Protection set-upsProtection set-ups define sets of files that are protected in a common way. Set-ups can be defined or embedded in-line in the server configuration file, or can be defined in separate, external files which are named in the server configuration file. The Protect and DefProt configuration directives are used to set up associations between protection set-ups and sets of files to be protected. The DefProt directive associates a default protection set-up with a file template, but does not activate protection. The syntax is:
DefProt template setup [user.group] The Protect directive associates a protection set-up with a file template and activates protection. The syntax is:
Protect template [setup [user.group]] If a file matches the template of a Protect directive that does not specify a protection set-up, the server regards the file as protected and searches the configuration rules for a match between the filename and a DefProt directive template. The user and group parameters specify the UNIX user ID and group ID with which the server process should run when serving files that match the protection rule. This allows the UNIX file protection mechanism to be used to restrict access. If these parameters are omitted, they default to nobody and nogroup. In the following example all files in the /restricted directory hierarchy are potentially protected by the DefProt directive. The first Protect directive will be matched by files within the confidential subdirectory and cause them to be protected. The third line explicitly associates a different protection set-up file with files in the /system directory.
DefProt /restricted/* /usr/local/etc/WWW/restricted WWW.sys Protect /restricted/confidential/* Protect /system/* /usr/local/etc/WWW/system A protection set-up can be the name of a separate protection set-up file containing protection information or can refer to a Protection directive earlier in the configuration file. Protection set-up files are simple text files and can be edited with any text editor. The following directives may be used in a protection set-up:
For example, a protection set-up file might contain the following information:
PasswdFile /usr/local/etc/WWW/passwd.restricted GroupFile /usr/local/etc/WWW/group.restricted GetMask authors ServerID restricted AuthType Basic This specifies a set-up allowing access to users in the group authors, as defined by the specified group and password files, and assigns the set-up the logical identifier, restricted. Starting with version 3.0 of the CERN server, protection set-ups can be defined in the server configuration file using the Protection directive or can be included in-line in Protect and DefProt directives. Protection set-up names must be defined before they are used. The syntax is:
Protection setup-name { directives ... } This defines a protection set-up named setup-name. Protection directives are enclosed within braces, as shown in the following example:
Protection AUTHORS-ONLY { UserID WWW GroupID sys AuthType Basic ServerID restricted PasswdFile /usr/local/etc/WWW/passwd.restricted GroupFile /usr/local/etc/WWW/group.restricted GetMask authors } The user and group specified in the server configuration file in protection set-ups using UserID and GroupID, and in DefProt and Protection directives, are the IDs that the server process should change to before serving the file; they default to nobody and nogroup respectively. The UserID and GroupID protection directives cannot be used in separate protection set-up files as these files may be outside the control of the Web server administrator. Protection set-ups can also be included in-line in DefProt and protect directives. The previous example could also be written:
Protect /contrib/misc/* { UserID WWW GroupID sys AuthType Basic ServerID restricted PasswdFile /usr/local/etc/WWW/passwd.restricted GroupFile /usr/local/etc/WWW/group.restricted GetMask authors } The protection set-up mechanism can be used for restricting access to proxy servers. For example if an internal network is given the IP mask: 192.168.0.0, the following lines in the server configuration file on the proxy server restrict access to that server to browsers on hosts on the internal network:
Protection internal-hosts { Mask @192.168.*.* }
Next: Server password files Up: CERN server access Previous: CERN server access
Spinning the Web by Andrew Ford |
||||||
Copyright © 1996-2002 Ford & Mason Ltd |