This section describes some common examples for restricting access to a Web server and its contents. Some of these examples assume you set up the default ACL to deny anyone access to the server. You can also add a deny all line as the first rule to each of these examples, as done in the example for the entire server.
This example allows access to users in a group called Employees, who access the server from computers in a sub-domain. There are no access control rules for other resources on the server. You might use this example if you have a server for a department and you only want users to access the server from computers in a specific subdomain of your network.
From the Web Manager home page, click Enterprise Web Server servername > Server Preferences > Restrict Access.
In the section called Pick a Resource, select the entire server from the Editing drop-down list.
The resource must be selected.
Click Edit Access Control.
Click New Line.
Click New Line again to create a second rule.
Click Deny in the second rule.
In the bottom form that appears, select Allow > click Update.
Click Anyone in the second rule.
In the bottom form, type the group that you want to have access to the server.
For this example, type Employees in the Group field.
HINT: Note that the two options, Authenticated People Only and Only the Following People, are checked automatically.
Click Update.
Click Anyplace in the second rule.
In the bottom form, type a wildcard pattern for the hostnames of the computers you want to allow.
For example, type *.emp.mozilla.com in the Host Names field.
Click Update.
Uncheck the Continue box in the second rule of the top frame > click Submit.
Click Save and Apply.
Be sure to restart the server for the changes to take effect. The following text is the ACL file for this example:
# File automatically written## You may edit this file by hand#version 3.0;acl "default";deny (all) user = "anyone";allow absolute (all) user = "employees" and dns = "*.emp.mozilla.com";
This example lets users in a group called Executives have read access to a directory and its subdirectories and files on the server. The user called CEO has full permissions to the directory.
You might use this example if you have a directory on your server that one person owns (he or she publishes to this directory) and you want one group of users to read the files. For example, you might have a project owner who publishes status information for the project team to review.
From the Web Manager home page, click Enterprise Web Server servername > Server Preferences > Restrict Access.
In the section called Pick a Resource, click Browse.
In the form that appears, click the link for the directory you want to restrict.
HINT: If you want to view all files in your server root, click Options on the Choose a Part of Your Server form > check the List Files As Well As Directories checkbox > click OK.
Click Edit Access Control.
Click New Line twice to create two rules.
IMPORTANT: Don't edit the default values for the first rule. These values deny all access to the directory. You'll edit the second rule to allow read access to the Executives group.
Click Deny in the second rule.
In the bottom form that appears, select Allow > click Update.
Click Anyone in the second rule.
In the bottom form, type the group you want to have access to the server.
For this example, type Executives in the Group field.
Click Update.
Click All in the top frame.
Uncheck the Write and Delete access rights.
Click Update.
Click New Line to create a rule for the CEO user.
Select Allow.
Click Anyone in the third rule.
In the bottom form, type CEO in the User field > click Update.
Uncheck Continue for both the second and the third rules.
This means that the server ignores any ACLs for directories or files under the directory you specified above.
Click Submit > Save and Apply.
The entry in the GENERATED.HTTPS-serverid.ACL file for this example looks like this:
acl "path=d:/novonyx/suitespot/docs/senior-staff/";
deny (all)
user = "anyone";
allow absolute (read,execute,list,info)
group = "executives";
allow absolute (all)
user = "ceo";
This example uses a URI to control access to a single user's content on the Web server. URIs are paths and files relative to the server's document root directory. Using URIs is an easy way to manage your server's content if you frequently rename or move all or part of it, for example, for disk space. It's also a good way to handle access control if you have additional document roots.
This example gives anyone read access to files and directories in the path specified by the URI /MY_DIRECTORY. Only one user (yourself in this example) has full access to the directories and files.
You might use this example if you have several users who publish their content on your server. The users want to have write access to their content, and they want anyone to have read/execute access.
From the Web Manager home page, click Enterprise Web Server servername > Server Preferences > Restrict Access.
In the section called Type In the ACL Name, type the URI you want to control.
For example, type URI=/my_directory. Click Edit Access Control. The two-frame forms appear.
Click New Line to create the first rule that allows all users read access.
Click Deny.
In the bottom form that appears, select Allow > click Update.
Click All.
Uncheck the Write and Delete access rights.
This means users can't add or remove files, but they can view them and run any applications in the directories.
Click Update.
Click New Line to create a rule for the owner of the directory > select Allow for the second rule.
Click Anyone.
In the bottom form, type ME in the User field > click Update.
Uncheck Continue for both the first and second rules.
This means that the server ignores any ACLs for other URIs, directories, or files under the URI you specified above.
Click Submit > Save and Apply.
The entry in the GENERATED.HTTPS-serverid.ACL file for this example looks like this:
acl "uri=/my_directory";
allow absolute (read,execute,list,info)
user = "anyone";
allow absolute (all)
user = "me";
This example controls write and delete access to all files with the extension .CGI. You might use this example if you only want specific users to create programs that run on your server. In this example, anyone can run the programs, but only users in the Programmers group can create or delete them.
From the Web Manager home page, click Enterprise Web Server servername > Server Preferences > Restrict Access.
In the section called Pick a Resource, click Wildcard.
In the prompt that appears, type *.CGI > click OK.
This wildcard pattern matches any request that contains a file or directory with the .CGI extension.
Click Edit Access Control.
Click New Line to create the first rule that will allow all users read access.
Click Deny.
In the bottom form that appears, select Allow > click Update.
Click All > uncheck the Write and Delete access rights.
This means users can't add or remove files or directories with the .CGI extension.
Click Update.
Click New Line to create a rule that allows write and delete access to the Programmers group.
Select Allow for the second rule.
Click Anyone.
In the bottom form, type Programmers in the Group field.
Click Update > Submit > Save and Apply.
In this example, both Continue boxes are checked. This means that if a file is requested, the server will first look at the ACL for the file type, and then it will continue to look for another ACL that matches, for example, an ACL on the URI or the path. The server checks ACLs in the following order:
The entry in the GENERATED.HTTPS-serverid.ACL file for this example looks like this:
acl "*.cgi";
allow (read,execute,list,info)
user = "anyone";
allow (all)
group = "programmers";
This example restricts write and delete access to the server during working hours. You might use this example if you don't want people publishing documents at times when people might be accessing the files. This example allows users to publish during the evening hours of the week (between 6:00 p.m. and 6:00a.m., Monday through Friday) and all times during the weekend.
From the Web Manager home page, click Enterprise Web Server servername > Server Preferences > Restrict Access.
In the section called Pick a Resource, select the entire server from the Editing drop-down list > click Edit Access Control.
Click New Line.
Click Deny.
In the bottom form that appears, select Allow > click Update.
Click All > uncheck the Write and Delete access rights.
This means that if a user wants to add, update, or delete a file or directory, this rule won't apply and the server will search for another rule that matches.
Click Update.
Click New Line to create a rule that restricts the write and delete methods.
Select Allow for the second rule.
Click the X link to create a customized expression.
In the bottom field, edit the existing lines to include the following:
user = "anyone" anddayofweek = "sat,sun" or(timeofday >= 1800 andtimeofday <= 600)
You might want to select the entire text element and copy it to memory; if there are errors, you'll have to re-enter the text.
Click Update.
The top form will display unrecognized expressions in the Users/Groups and From Host columns, because you created a custom expression.
Click Submit.
If you made any errors in the custom expression, you'll get a JavaScript alert. Correct any changes > click Submit again.
Click Save and Apply.
Restart your server for the changes to take effect.