//  ========================================================================
//  Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
//  ========================================================================
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================

[[jetty-xml-config]]
=== `jetty.xml`

`jetty.xml` is the default configuration file for Jetty, typically located at ` $JETTY_HOME/etc/jetty.xml`. Usually the `jetty.xml` configures:

* The Server class (or subclass if extended) and global options.
* A ThreadPool (min and max thread).
* Connectors (ports, timeouts, buffer sizes, protocol).
* The handler structure (default handlers and/or a contextHandlerCollections).
* The deployment manager that scans for and deploys webapps and contexts.
* Login services that provide authentication checking.
* A request log.

Not all Jetty features are configured in `jetty.xml`.
There are several optional configuration files that share the same format as `jetty.xml` and, if specified, concatenate to it.
These configuration files are also stored in `$JETTY_HOME/etc/`, and examples of them are in http://github.com/eclipse/jetty.project/jetty-server/src/main/config/etc/[Github Repository].
The selection of which configuration files to use is controlled by xref:advanced-start-features[] and the process of merging configuration is described in xref:jetty-xml-usage[].

[[root-element-jetty-xml]]
==== Root Element

`jetty.xml` configures an instance of the `Jetty org.eclipse.jetty.server.Server.`

[source, xml, subs="{sub-order}"]
----

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
 ...
</Configure>

      
----

[[jetty-xml-examples]]
==== Examples

`$JETTY_HOME/etc` contains the default `jetty.xml`, as well as other sample configuration files (`jetty-*.xml`) which can be passed to the server via the command line.

[[jetty-xml-additional-resources]]
==== Additional Resources

* xref:jetty-xml-syntax[] –in-depth reference for Jetty-specific configuration XML syntax.
* xref:jetty-xml-config[] –configuration file for configuring the entire server
