<?xml version="1.0" encoding="utf-8"?>
<httpConfig>
<!--
*****************
Jetty HTTP Server
*****************
-->
<Configure class="org.mortbay.jetty.Server">
<!--
***********
Add Listeners
***********
-->
<!--Start addlisteners-->
<!--Add SocketListener with default port 1060-->
<Call name="addListener">
<Arg>
<New class="org.mortbay.http.SocketListener">
<Set name="Port">1060</Set>
<Set name="MinThreads">5</Set>
<Set name="MaxThreads">50</Set>
<Set name="MaxIdleTimeMs">30000</Set>
<Set name="LowResourcePersistTimeMs">5000</Set>
</New>
</Arg>
</Call>
<!--End addlisteners-->
<Call name="addRealm">
<Arg>
<New class="org.mortbay.http.HashUserRealm">
<Arg>Admin Realm</Arg>
<Put name="admin">yourpasshere</Put>
<Call name="addUserToRole">
<Arg>admin</Arg>
<Arg>server-administrator</Arg>
</Call>
</New>
</Arg>
</Call>
<!--
************
Add Server Contexts
************
-->
<!--Default context at root / -->
<Call name="addContext">
<Arg>/</Arg>
<Set name="realmName">Admin Realm</Set>
<Set name="authenticator">
<New class="org.mortbay.http.BasicAuthenticator" />
</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.http.handler.SecurityHandler" />
</Arg>
</Call>
<Call name="addSecurityConstraint">
<Arg>/</Arg>
<Arg>
<New class="org.mortbay.http.SecurityConstraint">
<Arg>Admin</Arg>
<Arg>server-administrator</Arg>
</New>
</Arg>
</Call>
<Call name="addHandler">
<Arg>
<New class="org.ten60.transport.jetty.HttpHandler">
<Set name="Name">BackendHTTPTransport</Set>
</New>
</Arg>
</Call>
</Call>
</Configure>
</httpConfig>
Jetty also provides HashUserRealm that reads a property file in which the user names and passwords can be specified.
No comments:
Post a Comment