private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Sometimes it is required to serve different web applications from
different ports/connectors. The simplest way to do this is to create
Server instances, however if contexts need to share
resources (eg data sources, authentication), or if the mapping of ports to
web applications is not cleanly divided, then the named connector mechanism
can be used.
How to create multiple server instances is simply done when writing embedded jetty code by creating multiples instances of the Server class and configuring them as needed. This is also easy to achieve if you are configuring your servers in XML. The id field in the Configure element of jetty.xml files is used to identify the instance that the configuration applies to, so to run two instances of the Server, you can copy the jetty.xml, jetty-http.xml and other jetty configuration files used and change the "Server" id to a new name. This can be done in the same style and layout as the existing jetty.xml files or the multiple XML files may be combined to a single file.
When creating new configurations for alternative server:
Change all id="Server" to the new server
For all connectors for the new server change the refid in the
Make sure that any references to properties like jetty.port are either renamed or replaced with absolute values
Make sure that any deployers AppProviders refer to a different "webapps" directory so that a different set of applications are deployed.
It is also possible to use an extension to the virtual host mechanism with named to connectors to make some web applications only accessible by specific connectors. If a connector has a name "MyConnector" set using the setName method, then this can be referenced with the special virtual host name "@MyConnector".