Overview of server.xml

                                                                                                                                                                                                                                                                                                                                      Back to [Book]     [Topic]

Overview of server.xml

The server.xml file contains most of the configuration information needed to run the server. The server.xml file is located in the instance_dir/config directory. The encoding is UTF-8 to maintain compatibility with regular UNIX text editors.

sun-web-server_7_0.xsd

The sun-web-server_7_0.xsd schema validates the format and content of the server.xml file. The schema enforces type checks. For example, it ensures that the ip element specifies a valid IP address. The sun-web-server_7_0.xsd file is located in the install_dir/lib/dtds directory.

Editing server.xml

The structure of server.xml is a hierarchy, with server as the topmost element. The server element has many subelements, many of which have subelements of their own.

In general, you do not need to edit server.xml directly. Instead, use the Admin Console and the wadm command-line interface to change values in server.xml. Using wadm when creating scripts to change server.xml assures you of forward compatibility. If you do edit server.xml directly, exercise caution to make sure that the resulting server.xml file is valid.

Editing Element Values

To change the values in server.xml, change the value between the tags associated with the element you are editing. For example, to change the log level from info to fine, find the log child element of the server element. In this example, you see the following lines:

  <log>
    <log-file>../logs/errors</log-file>
    <log-level>info</log-level>
  </log>

To change the log level from info to fine, change the line:

<log-level>info</log-level>

to:

<log-level>fine</log-level>

After you make changes to the server.xml file, you must deploy your configuration for most changes to take effect. Use the command-line interface command wadm pull-config to pull the modified server.xml file, then use the Admin Console or the wadm deploy-config command to deploy your changes. For some changes, you must restart the server before they take effect. For information on which changes require a restart and which do not, see Dynamic Reconfiguration.

Adding Elements

To add a new element to sever.xml, add the element and any required subelements. Elements begin with a tag, for example <virtual-server>, and end with the closing tag, for example </virtual-server>. The tags are case-sensitive.

Validating server.xml

After editing server.xml, Web Server automatically validates the XML when you start or dynamically reconfigure a the server.

You can also use the –cofigtest option of the startserv script to validate your configuration. From the instance's bin directory, run:

 startserv -configtest 

Labels

configurationfile configurationfile Delete
+configguide +configguide Delete
java java Delete
server server Delete
configuration configuration Delete
administrator's administrator's Delete
sun sun Delete
webserver webserver Delete
application application Delete
system system Delete
webtier webtier Delete
file file Delete
guide guide Delete
webserver70 webserver70 Delete
sunjava sunjava Delete
filereference filereference Delete
web web Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact