Previous Contents Index Next
Sun ONE Web Server 6.1 Administrator's Guide

> ## Chapter 17
> Applying Configuration Styles

> Configuration styles are an easy way to apply a set of options to specific files or directories that your various virtual servers maintain. For example, you can create a configuration style that sets up access logging. When you apply that configuration style to the files and directories that you want to log, you don’t have to individually configure access logging for all the files and directories in your virtual server.

> This chapter includes the following sections:

> - Creating a Configuration Style
> - Assigning a Configuration Style
> - Listing Configuration Style Assignments
> - Editing a Configuration Style
> - Removing a Configuration Style

> ##

> Creating a Configuration Style

> To create a configuration style, perform the following steps:

> 1. Access the Class Manager.
> 2. Choose the Styles tab.
> 3. Click the New Style link.
> 4. Type the name you want to give the configuration style. Click OK.

> Sun ONE Web Server displays the Edit a Style page.

> 5. From the drop-down list, choose a configuration style to edit and click Edit this Style.
> 6. From the list of links available, click the category you want to configure for your style.

> You can configure the information listed in Table 17-1.

> 7. Fill out the form that appears, and click OK.
> 8. Repeat step 4 and step 5 to make any other configuration changes to the configuration style. Click OK.

> When you choose a style to edit, your Resource Picker lists configuration styles instead of other resources. After you have finished editing a style, click OK and Save and Apply. The Resource Picker exits the styles mode. You can also choose to exit the styles mode by choosing Exit styles mode from the Resource Picker. For more information about the Resource Picker, see "Using the Resource Picker" of Chapter 1, "Introduction to Sun ONE Web Server".

> Table 17-1 Configuration Style Categories

> Category | Description
> --- | ---
> CGI file type | Allows you to activate CGI as a file type. For more information about CGIs, see "Installing CGI Programs," on page 355 in Chapter 15, "Extending Your Server With Programs".
> Character Set | Allows you to change the character set for a resource. For more information about character sets, see "Changing the Character Set," on page 376 in Chapter 16, "Content Management".
> Default Query Handler | Allows you to set a default query handler for a server resource. For more information about query handling, see "Using the Query Handler," on page 365 in Chapter 15, "Extending Your Server With Programs".
> Document Footer | Allows you to add a document footer to a server resource. For more information, see "Setting the Document Footer" in Chapter 16, "Content Management".
> .htaccess Configuration | Allows you to give people a subset of configuration options without giving them access to the Server Manager. For more information about access control, see Chapter 9, "Controlling Access to Your Server".
> Require Stronger Security | Allows you to specify key size restrictions, or to reject access with a specific file.
> Error Responses | Allows you to customize the error responses that clients see when they encounter an error from your server.
> Log preferences | Allows you to set preferences for access logs. For more information about log preferences, see "Setting Access Log Preferences," on page 242 in Chapter 10, "Using Log Files".
> Remote File Manipulation | Allows you to activate the file manipulation commands which allow remote browsers to change your server’s documents. For more information, see "Enabling Remote File Manipulation" in Chapter 16, "Content Management".
> Server Parsed HTML | Allows you to specify whether the server parses files before they are sent to the client. For more information, see the Sun ONE Web Server 6.1 Programmer’s Guide.
> Serve Precompressed Content | Allows you to specify whether the server sends a precompressed version of the file. For more information, see "Configuring the Server to Serve Precompressed Content" in Chapter 16, "Content Management".
> Compress Content on Demand | Allows you to specify whether the server dynamically compresses content before it is sent to the client. For more information, see "Configuring the Server to Compress Content on Demand" in Chapter 16, "Content Management".
> Symbolic links (UNIX/Linux) | Allows you to limit the use of filesystem links in your server. For more information, see "Restricting Symbolic Links (UNIX/Linux)" in Chapter 16, "Content Management".

> For more information, see the New Style page in the online help.

> ##

> Assigning a Configuration Style

> Once you’ve created a configuration style, you can assign it to files or directories in your virtual server. You can specify either individual files and directories or wildcard patterns (such as *.gif).

> To assign a configuration style, perform the following steps:

> 1. Access the Class Manager.
> 2. Choose the Styles tab.
> 3. Click the Assign Style link.
> 4. Enter the prefix of the URL to which you are applying this configuration style.

> If you choose a directory inside the document root, only enter the path after the document root. If you enter /* after the directory, you apply the configuration style to all of the directory’s contents.

> 5. Select the configuration style you want to apply.

> To remove any configuration style previously applied to the resource, apply the None configuration style. Click OK.

> For more information, see the Assign a Style page in the online help.

> ##

> Listing Configuration Style Assignments

> After you have created configuration styles and applied them to files or directories, you can get a list of the configuration styles and where you applied them.

> To list the configuration style assignments, perform the following steps:

> 1. Access the Class Manager.
> 2. Choose the Styles tab.
> 3. Click the List Assignments link.

> Sun ONE Web Server displays the List Assignments page, showing the configuration styles you applied to server resources.

> 4. To edit a configuration style assignment, click the Edit link next to the configuration style name.

> For more information, see the List Assignments page in the online help.

> ##

> Editing a Configuration Style

> To edit a configuration style, perform the following steps:

> 1. Access the Class Manager.
> 2. Choose the Styles tab.
> 3. Click the Edit Style link.
> 4. Select the configuration style you want to edit and click the “Edit this style” button.
> 5. From the list of links available, click the category you want to configure for your style.

> For more information on these categories, see the section Creating a Configuration Style.

> 6. Fill out the form that appears, and then click OK.
> 7. Repeat Step 4 and Step 5 to make any other changes to the configuration style. Click OK.

> When you choose a style to edit, your Resource Picker lists configuration styles instead of other resources. After you have finished editing a style, click OK and Save and Apply. The Resource Picker exits the styles mode. You can also choose to exit the styles mode by choosing Exit styles mode from the Resource Picker. For more information about the Resource Picker, see "Using the Resource Picker" of Chapter 1, "Introduction to Sun ONE Web Server".

> For more information, see the Edit Style page in the online help.

> ##

> Removing a Configuration Style

> Before removing a configuration style, remove assignments that had the configuration style applied to them. If you do not do this before removing the configuration style, you must manually edit the obj.conf file of your class of virtual server, searching for the configuration style in the file and replacing it with None. If you don’t do this search and replace, anyone who accesses the files or directories that had the deleted configuration style applied will get a server misconfiguration error message.

> To remove a configuration style, perform the following steps:

> 1. Access the Class Manager.
> 2. Choose the Styles tab.
> 3. Click List Assignments link.
> 4. Select Edit Style Assignment you want to remove.
> 5. Click Remove this Assignment.

> For more information, see the Remove Style page in the online help.

> Previous Contents Index Next

> Copyright 2004 Sun Microsystems, Inc. All rights reserved.