Home > Articles > Operating Systems, Server > Solaris

This chapter is from the book

This chapter is from the book

5.3 The obj.conf File

The obj.conf (or object configuration) file contains instructions on how to process HTTP client requests. This file consists of various directives that map directly to request processing stages and enable your Web Server to process client requests immediately after installation.

An initial object configuration file is created for each Web Server configuration; the name of the file is simply obj.conf. Additional object configuration files may also exist for any virtual servers created using the Administration Console or command line interface. The default name for each virtual server object configuration file is vsname-obj.conf (where vsname is the name of the virtual server). The <object-file> element in the server.xml file specifies the name of the object configuration file to use to process requests for that virtual server. Example 5.3 demonstrates the use of the <object-file> element in the server.xml file.

Example 5.3. Virtual Server Definition for the Object Configuration File

<virtual-server>
  <name>www.example.com</name>
  <http-listener-name>http-listener-1</http-listener-name>
  <host>www.example.com</host>
  <object-file>www.example.com-obj.conf</object-file>
  <document-root>/export/home/example.com/public_html</document-root>
  <access-log>
  <file>/export/home/example.com/logs/access</file>
  </access-log>
</virtual-server>

When the Web Server receives a request, it uses information contained within the server.xml file to select an appropriate virtual server. It then uses the file specified by the <object-file> element to determine how to process the request. Multiple object configuration files allow the flexibility to process requests differently for each virtual server.

5.3.1 File Structure

The obj.conf file contains a series of instructions (or directives) that tell the server what to do at each stage of the request-handling process. These directives are grouped together by <Object> tags. Each directive invokes a SAF with one or more arguments.

Example 5.4 demonstrates the obj.conf file for the default Administration Node.

Example 5.4. Default obj.conf File

#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

# You can edit this file, but comments and formatting changes
# might be lost when you use the administration GUI or CLI.

<Object name="default">
AuthTrans fn="match-browser" browser="*MSIE*"
  ssl-unclean-shutdown="true"
NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/webserver7/lib/icons"
  name="es-internal"
PathCheck fn="unix-uri-clean"
PathCheck fn="find-pathinfo"
PathCheck fn="find-index-j2ee"
PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"
ObjectType fn="type-j2ee"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Service method="(GET|HEAD)" type="magnus-internal/directory"
  fn="index-common"
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*"
  fn="send-file"
Service method="TRACE" fn="service-trace"
Error fn="error-j2ee"
AddLog fn="flex-log"
</Object>

<Object name="j2ee">
Service fn="service-j2ee" method="*"
</Object>

<Object name="es-internal">
</Object>

<Object name="es-internal">
</Object>

<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi"
</Object>

<Object name="send-precompressed">
PathCheck fn="find-compressed"
</Object>

<Object name="compress-on-demand">
Output fn="insert-filter" filter="http-compression"
</Object>

5.3.2 Syntax

Directives in the object configuration file follow a syntax similar to those contained in the magnus.conf (refer to Table 5.2 for details). The exception is that the object configuration file also contains objects (called templates) for grouping directives together. Templates enable you to process directives on a conditional basis.

The overall structure of the object configuration file is as follows:

    <Object name="default">
    directives
    </Object>

    <Object name="objectname">
    directives
    </Object>
    ...
    <Object name="objectname">
    directives
    </Object>

The order of these templates is not important, but there must exist one template with the name default. The directives contained in the default template are used to process every request. The object configuration file for Web Server 7 contains a standard default template with directives for standard request processing. This enables you to process requests immediately after installation.

Some syntax errors in the object configuration file might cause situations where the server instance cannot start, whereas others might not be noticed until a request is processed.

Examples of errors that prevent an instance from starting include an incorrect spelling of the directive name or the name of a directive parameter and can be found in the following example:

    NameTrans func="pfx2dir" from="/mc-icons" dir="/opt/webserver7/lib/
        icons" name="es-internal"

In this example, the directive parameter, fn, has been incorrectly specified as func. If this were to occur, you would see an error similar to the following when you attempted to start the instance:

    config: CONF2265: Error parsing file obj.conf, line 12, column 1:
         Missing parameter (need fn)
    config: CORE3235: File server.xml line 71: Error processing
      <object-file> element: Error processing file obj.conf
    failure: server initialization failed

Other syntax errors are not so easily noticed and might not be recognized until a request is processed. For example, if you specify an incorrect SAF in the function (fn) specification as follows:

    NameTrans fn="badfunc" from="/mc-icons" dir="/opt/webserver7/lib/
        icons" name="es-internal"

you would see a warning message at start-up as follows:

    config: trying to GET /, func_exec reports: HTTP2122: cannot find
         function named badfunc

and the following message in the errors log:

    [22/Jul/2007:08:23:55] config ( 3546): for host 24.26.101.117 trying to
       GET /mc-icons/image.gif, func_exec reports: HTTP2122: cannot find
       function named badfunc
    info: HTTP3072: http-listener-1: http://www.example.com:80 ready to
    accept requests
    info: CORE3274: successful server startup

These types of errors might not be noticed if the instance is configured to start when the server reboots. Instead, the server might start properly and flag an error message, but it isn’t until a request comes in for that resource that the server error is noticed.

The following subsections contain an overview of directives and objects found in the object configuration file. Refer to Chapter 6 for a detailed explanation of request processing.

5.3.2.1 Directives

Directives in the object configuration file invoke SAFs at various request processing stages. The stage is specified as the first parameter of the directive.

Each directive calls a function and specifies zero or more parameters that are necessary for the SAF to process the request at that stage. The function name and/or parameters are specified with reserved words, so the order in which they appear in the directive is not important. In general, however, the syntax for each directive in the object configuration file is as follows:

    Directive fn="function" name1="value1" ... nameN="valueN"

Where Directive is the stage at which the directive is processed. The value of the function (fn) parameter is the name of the SAF to execute. All directives must supply a value for the fn parameter; if there is no function, the instruction will do nothing. Function names can be composed of letters, digits, underscores (_), or hyphens (-). The remaining parameters are the arguments needed by the function, and they vary from function to function.

An example of a directive that applies to the NameTrans (Name Translation) stage of request processing would be

    NameTrans fn="document-root" root="/opt/Sun/webserver7/https-www.
       example.com/docs"

In this example, the directive is executed during the NameTrans stage of request processing and invokes the document-root SAF to specify the document root directory for the server. The document-root SAF uses one parameter, root, to specify the path to the document root directory.

Parameters can contain references to variables and expressions. The variables can be predefined variables, variables defined at request time using the set-variable SAF, or variables defined in server.xml.

It is not required, but it is a best practice to group directives according to the stage in which they are processed (for example, all NameTrans directives should be grouped together). This enables you to easily recognize and debug problems within the object configuration file.

The order in which directives appear within a particular group becomes important if the directives are conditionally executed. A common error is to place directives that are processed unconditionally before those that are conditional in nature. In such a case, the conditional directives might never be processed.

Another best practice is to place directive groups in the order of request processing stages (for example, AuthTrans, NameTrans, PathCheck, ObjectType, Service, Error, and AddLog) because this also aids in debugging.

5.3.2.2 Objects

Directives in the object configuration file are grouped together by objects (which are also referred to as containers or templates). Objects are specified by the <Object> tag and enable you to define directives that are executed only on certain conditions. Example 5.4 demonstrates various objects that are defined as part of the default object configuration file.

One of the most common attributes for the <Object> tag is the name attribute, which uniquely identifies the object within the configuration file. The syntax for objects that use the name attribute is as follows:

    <Object name="objectname">
    directives
    </Object>

The object configuration file contains a default object that tells the instance how to process requests by default.

    <Object name="default">
    directives
    </Object>

The object configuration file can contain objects that are executed only when certain conditions are true for a particular NameTrans directive. Two such conditions involve the use of additional named objects or ppath objects.

Named Object Processing

One such example of conditional processing is the use of the optional name attribute in the NameTrans directive. Assume that a client is requesting the following URL:

    http://www.example.com/mc-icons/back.gif

During request processing, the server evaluates each NameTrans directive in the default object in an attempt to locate a match. In this case, the second directive is matched because the URI begins with /mc-icons.

    NameTrans fn="ntrans-j2ee" name="j2ee"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/webserver7/lib/
      icons" name="es-internal"

The server then determines whether a name attribute has been specified for the directive.

    NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/webserver7/lib/
      icons" name="es-internal"

If the directive specifies a name attribute, the value of the attribute points to another object that contains additional directives that should be used for processing the request.

    <Object name="es-internal">
    directives
    </Object>

Any directives found in the additional object are processed prior to those found in the default object for the particular stage being processed.

ppath Object Processing

Another example of conditional processing is the use of the ppath (partial path) object.

    <Object ppath="path">
    directives
    </Object>

The ppath object enables you to specify a path to a document or resource where directives contained in the object are executed only if the path to the resource can be found beneath the location specified in the ppath value. For example, suppose you specify a ppath object as follows:

    <Object ppath="/opt/webserver7/https-www.example.com/docs/
       private/*">
    directives
    </Object>

During the processing of the NameTrans directive, if it is determined that the resource can be found beneath the /opt/webserver7/https-www.example.com/docs/private/ directory, then any directives found within this ppath object are processed prior to those found in the default object.

In general, the server always starts processing requests with the default object and may process directives in other objects based on conditions within the NameTrans directive. Each new object added to the object configuration file has the potential to modify the default object’s behavior.

5.3.2.3 Variables

SAF parameters can contain references to variables and expressions. The variables can be predefined variables, variables defined at request time using the set-variable SAF, or variables defined in the server.xml file.

Within the server.xml file itself, a variable can be defined at various levels (for example, <server> and <virtual-server>). As such, the server must have a method for resolving duplicate variable definitions. The server consults the following namespaces (in the following order) when attempting to resolve a variable:

  1. Predefined variables
  2. Variables defined at request time through the use of the set-variable SAF
  3. Virtual Server–specific variables defined at the <virtual-server> level
  4. Server variables defined at the <server> level

Web Server variables begin with a dollar sign character ($), followed by either upper- or lowercase letters as the next character. Subsequent characters can include any combination of upper- or lowercase alphanumeric characters or underscores (_).

A regular expression notation for variable syntax would be as follows:

    \$[A-Za-z][A-Za-z0-9_]*

Examples of valid variable names include $variable, $Variable, $var_iable, or $var9. Examples of invalid variable names include $_variable and $9variable.

5.3.3 Context

The server.xml file contains definitions for each virtual server contained within the instance, so there is a one-to-many relationship between the server.xml file and virtual servers.

Each virtual server can use a different object configuration file for processing requests. Therefore, there is a one-to-many relationship between an instance and the object configuration file(s), but there is a one-to-one relationship between the virtual server and its object configuration file.

5.3.4 Modifications

Some changes made through the Administration Console or the command line interface update the appropriate object configuration file. If this file is updated as a result of changes made through either of these two interfaces, you must deploy the updated configuration before the changes are reflected on the appropriate Administration Node(s).

The object configuration file is read when the instance is started or when a dynamic reconfiguration is performed. The syntax for the directives and parameters contained in the object configuration file is validated within the start-up or reconfiguration code base. They are not validated against a schema such as the server.xml file.

Errors found within the file may prevent the instance from starting or processing requests properly.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020