1 | <?xml version="1.0" encoding="UTF-8" ?> |
---|
2 | <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd"> |
---|
3 | |
---|
4 | <!-- ========================================================================= --> |
---|
5 | <!-- This file configures the Jetty server. --> |
---|
6 | <!-- All changes require a restart of I2P. --> |
---|
7 | <!-- --> |
---|
8 | <!-- Commonly changed settings: --> |
---|
9 | <!-- * host: Change 127.0.0.1 to 0.0.0.0 in the addListener section --> |
---|
10 | <!-- to access the server directly (bypassing i2p) --> |
---|
11 | <!-- from other computers. The included version of Jetty has --> |
---|
12 | <!-- been patched to allow IPv6 addresses as well, --> |
---|
13 | <!-- enclosed in brackets e.g. [::1] --> |
---|
14 | <!-- * port: Default 7658 in the addListener section --> |
---|
15 | <!-- * docroot: Change the ResourceBase in the addContext section --> |
---|
16 | <!-- to serve files from a different location. --> |
---|
17 | <!-- * threads: Raise MinThreads and/or MaxThreads in the addListener section --> |
---|
18 | <!-- if you have a high-traffic site and get a lot of warnings. --> |
---|
19 | <!-- * Uncomment the addWebApplications section to use to enable --> |
---|
20 | <!-- war files placed in the webapps/ dir. --> |
---|
21 | <!-- * Uncomment the line to allow Jetty to follow symlinks --> |
---|
22 | <!-- --> |
---|
23 | <!-- I2P uses Jetty 5.1.15. We have no plans to upgrade to Jetty 6, due to --> |
---|
24 | <!-- the significant changes in the API. If you need web server features not --> |
---|
25 | <!-- found in Jetty 5, you may install and run Jetty 6 in a different JVM, --> |
---|
26 | <!-- or run any other web server such as Apache. If you do run another --> |
---|
27 | <!-- web server instead, be sure and disable the Jetty 5 server for your --> |
---|
28 | <!-- eepsite on http://127.0.0.1:7657/configclients.jsp . --> |
---|
29 | <!-- --> |
---|
30 | <!-- Jetty errors and warnings will appear in wrapper.log, check there --> |
---|
31 | <!-- to diagnose problems. --> |
---|
32 | <!-- --> |
---|
33 | <!-- Note that the XML encoding for this file is UTF-8. --> |
---|
34 | <!-- --> |
---|
35 | <!-- If you have a 'split' directory installation, with configuration --> |
---|
36 | <!-- files in ~/.i2p (Linux) or %APPDATA%\I2P (Windows), be sure to --> |
---|
37 | <!-- edit the file in the configuration directory, NOT the install directory. --> |
---|
38 | <!-- --> |
---|
39 | <!-- ========================================================================= --> |
---|
40 | |
---|
41 | <!-- =============================================================== --> |
---|
42 | <!-- Configure the Jetty Server --> |
---|
43 | <!-- --> |
---|
44 | <!-- Documentation of this file format can be found at: --> |
---|
45 | <!-- http://docs.codehaus.org/display/JETTY/jetty.xml --> |
---|
46 | <!-- --> |
---|
47 | <!-- =============================================================== --> |
---|
48 | |
---|
49 | |
---|
50 | <Configure id="Server" class="org.mortbay.jetty.Server"> |
---|
51 | |
---|
52 | <!-- =========================================================== --> |
---|
53 | <!-- Server Thread Pool --> |
---|
54 | <!-- =========================================================== --> |
---|
55 | <Set name="ThreadPool"> |
---|
56 | |
---|
57 | <!-- If you don't have threadpool |
---|
58 | <New class="org.mortbay.thread.QueuedThreadPool"> |
---|
59 | <Set name="minThreads">1</Set> |
---|
60 | <Set name="maxThreads">16</Set> |
---|
61 | <Set name="lowThreads">2</Set> |
---|
62 | </New> |
---|
63 | --> |
---|
64 | |
---|
65 | <!-- Optional Java 5 bounded threadpool with job queue |
---|
66 | <New class="org.mortbay.thread.concurrent.ThreadPool"> |
---|
67 | <Set name="corePoolSize">1</Set> |
---|
68 | <Set name="maximumPoolSize">16</Set> |
---|
69 | </New> |
---|
70 | --> |
---|
71 | </Set> |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | <!-- =========================================================== --> |
---|
76 | <!-- Set connectors --> |
---|
77 | <!-- =========================================================== --> |
---|
78 | <!-- One of each type! --> |
---|
79 | <!-- =========================================================== --> |
---|
80 | |
---|
81 | <!-- Use this connector for many frequently idle connections |
---|
82 | and for threadless continuations. |
---|
83 | --> |
---|
84 | <Call name="addConnector"> |
---|
85 | <Arg> |
---|
86 | <New class="org.mortbay.jetty.nio.SelectChannelConnector"> |
---|
87 | <Set name="host">127.0.0.1</Set> |
---|
88 | <Set name="port">7658</Set> |
---|
89 | <Set name="maxIdleTime">60000</Set> |
---|
90 | <Set name="Acceptors">2</Set> |
---|
91 | <Set name="statsOn">false</Set> |
---|
92 | <Set name="confidentialPort">8443</Set> |
---|
93 | <Set name="lowResourcesConnections">5000</Set> |
---|
94 | <Set name="lowResourcesMaxIdleTime">5000</Set> |
---|
95 | </New> |
---|
96 | </Arg> |
---|
97 | </Call> |
---|
98 | |
---|
99 | <!-- Use this connector if NIO is not available. |
---|
100 | <Call name="addConnector"> |
---|
101 | <Arg> |
---|
102 | <New class="org.mortbay.jetty.bio.SocketConnector"> |
---|
103 | <Set name="port">7658</Set> |
---|
104 | <Set name="maxIdleTime">50000</Set> |
---|
105 | <Set name="lowResourceMaxIdleTime">1500</Set> |
---|
106 | </New> |
---|
107 | </Arg> |
---|
108 | </Call> |
---|
109 | --> |
---|
110 | |
---|
111 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
112 | <!-- To add a HTTPS SSL listener --> |
---|
113 | <!-- see jetty-ssl.xml to add an ssl connector. use --> |
---|
114 | <!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml --> |
---|
115 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
116 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
117 | <!-- Add a HTTPS SSL listener on port 8443 --> |
---|
118 | <!-- --> |
---|
119 | <!-- In the unlikely event you would want SSL support for your eepsite. --> |
---|
120 | <!-- You would need to generate a selfsigned certificate in a keystore --> |
---|
121 | <!-- in ~/.i2p/eepsite/keystore.ks, for example with the command line: --> |
---|
122 | <!-- |
---|
123 | keytool -genkey -storetype JKS -keystore ~/.i2p/eepsite/keystore.ks -storepass changeit -alias console -dname CN=xyz123.eepsite.i2p.net,OU=Eepsite,O=I2P Anonymous Network,L=XX,ST=XX,C=XX -validity 3650 -keyalg DSA -keysize 1024 -keypass myKeyPassword |
---|
124 | --> |
---|
125 | <!-- Change the CN and key password in the example, of course. --> |
---|
126 | <!-- You wouldn't want to open this up to the regular internet, --> |
---|
127 | <!-- would you?? Untested and not recommended. --> |
---|
128 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
129 | |
---|
130 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
131 | <!-- To allow Jetty to be started from xinetd --> |
---|
132 | <!-- mixin jetty-xinetd.xml: --> |
---|
133 | <!-- java -jar start.jar etc/jetty.xml etc/jetty-xinetd.xml --> |
---|
134 | <!-- --> |
---|
135 | <!-- See jetty-xinetd.xml for further instructions. --> |
---|
136 | <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
---|
137 | |
---|
138 | <!-- =========================================================== --> |
---|
139 | <!-- Set up global session ID manager --> |
---|
140 | <!-- =========================================================== --> |
---|
141 | <!-- |
---|
142 | <Set name="sessionIdManager"> |
---|
143 | <New class="org.mortbay.jetty.servlet.HashSessionIdManager"> |
---|
144 | <Set name="workerName">node1</Set> |
---|
145 | </New> |
---|
146 | </Set> |
---|
147 | --> |
---|
148 | |
---|
149 | <!-- =========================================================== --> |
---|
150 | <!-- Set handler Collection Structure --> |
---|
151 | <!-- =========================================================== --> |
---|
152 | <Set name="handler"> |
---|
153 | <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection"> |
---|
154 | <Set name="handlers"> |
---|
155 | <Array type="org.mortbay.jetty.Handler"> |
---|
156 | <Item> |
---|
157 | <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/> |
---|
158 | </Item> |
---|
159 | <Item> |
---|
160 | <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/> |
---|
161 | </Item> |
---|
162 | <Item> |
---|
163 | <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/> |
---|
164 | </Item> |
---|
165 | </Array> |
---|
166 | </Set> |
---|
167 | </New> |
---|
168 | </Set> |
---|
169 | |
---|
170 | <!-- =========================================================== --> |
---|
171 | <!-- Configure the context deployer --> |
---|
172 | <!-- A context deployer will deploy contexts described in --> |
---|
173 | <!-- configuration files discovered in a directory. --> |
---|
174 | <!-- The configuration directory can be scanned for hot --> |
---|
175 | <!-- deployments at the configured scanInterval. --> |
---|
176 | <!-- --> |
---|
177 | <!-- This deployer is configured to deploy contexts configured --> |
---|
178 | <!-- in the $JETTY_HOME/contexts directory --> |
---|
179 | <!-- --> |
---|
180 | <!-- =========================================================== --> |
---|
181 | <Call name="addLifeCycle"> |
---|
182 | <Arg> |
---|
183 | <New class="org.mortbay.jetty.deployer.ContextDeployer"> |
---|
184 | <Set name="contexts"><Ref id="Contexts"/></Set> |
---|
185 | <Set name="configurationDir">./eepsite/contexts</Set> |
---|
186 | <Set name="scanInterval">0</Set> |
---|
187 | </New> |
---|
188 | </Arg> |
---|
189 | </Call> |
---|
190 | |
---|
191 | <!-- =========================================================== --> |
---|
192 | <!-- Configure the webapp deployer. --> |
---|
193 | <!-- A webapp deployer will deploy standard webapps discovered --> |
---|
194 | <!-- in a directory at startup, without the need for additional --> |
---|
195 | <!-- configuration files. It does not support hot deploy or --> |
---|
196 | <!-- non standard contexts (see ContextDeployer above). --> |
---|
197 | <!-- --> |
---|
198 | <!-- This deployer is configured to deploy webapps from the --> |
---|
199 | <!-- $JETTY_HOME/webapps directory --> |
---|
200 | <!-- --> |
---|
201 | <!-- Normally only one type of deployer need be used. --> |
---|
202 | <!-- --> |
---|
203 | <!-- =========================================================== --> |
---|
204 | <Call name="addLifeCycle"> |
---|
205 | <Arg> |
---|
206 | <New class="org.mortbay.jetty.deployer.WebAppDeployer"> |
---|
207 | <Set name="contexts"><Ref id="Contexts"/></Set> |
---|
208 | <Set name="webAppDir">./eepsite/webapps</Set> |
---|
209 | <Set name="parentLoaderPriority">false</Set> |
---|
210 | <Set name="extract">true</Set> |
---|
211 | <Set name="allowDuplicates">false</Set> |
---|
212 | <Set name="defaultsDescriptor">./eepsite/etc/webdefault.xml</Set> |
---|
213 | </New> |
---|
214 | </Arg> |
---|
215 | </Call> |
---|
216 | |
---|
217 | <!-- =========================================================== --> |
---|
218 | <!-- Configure Authentication Realms --> |
---|
219 | <!-- Realms may be configured for the entire server here, or --> |
---|
220 | <!-- they can be configured for a specific web app in a context --> |
---|
221 | <!-- configuration (see $(jetty.home)/contexts/test.xml for an --> |
---|
222 | <!-- example). --> |
---|
223 | <!-- =========================================================== --> |
---|
224 | <!-- UNCOMMENT TO ACTIVATE |
---|
225 | <Set name="UserRealms"> |
---|
226 | <Array type="org.mortbay.jetty.security.UserRealm"> |
---|
227 | <Item> |
---|
228 | <New class="org.mortbay.jetty.security.HashUserRealm"> |
---|
229 | <Set name="name">Test Realm</Set> |
---|
230 | <Set name="config">./eepsite/etc/realm.properties</Set> |
---|
231 | <Set name="refreshInterval">0</Set> |
---|
232 | </New> |
---|
233 | </Item> |
---|
234 | </Array> |
---|
235 | </Set> |
---|
236 | --> |
---|
237 | |
---|
238 | <!-- =========================================================== --> |
---|
239 | <!-- Configure Request Log --> |
---|
240 | <!-- Request logs may be configured for the entire server here, --> |
---|
241 | <!-- or they can be configured for a specific web app in a --> |
---|
242 | <!-- contexts configuration (see $(jetty.home)/contexts/test.xml --> |
---|
243 | <!-- for an example). --> |
---|
244 | <!-- =========================================================== --> |
---|
245 | <Ref id="RequestLog"> |
---|
246 | <Set name="requestLog"> |
---|
247 | <New id="RequestLogImpl" class="org.mortbay.http.I2PRequestLog"> |
---|
248 | <Set name="filename">./eepsite/logs/yyyy_mm_dd.request.log</Set> |
---|
249 | <Set name="filenameDateFormat">yyyy_MM_dd</Set> |
---|
250 | <Set name="retainDays">90</Set> |
---|
251 | <Set name="append">true</Set> |
---|
252 | <Set name="extended">false</Set> |
---|
253 | <Set name="logCookies">false</Set> |
---|
254 | <Set name="LogTimeZone">GMT</Set> |
---|
255 | </New> |
---|
256 | </Set> |
---|
257 | </Ref> |
---|
258 | |
---|
259 | <!-- =========================================================== --> |
---|
260 | <!-- extra options --> |
---|
261 | <!-- =========================================================== --> |
---|
262 | <Set name="stopAtShutdown">true</Set> |
---|
263 | <Set name="sendServerVersion">false</Set> |
---|
264 | <Set name="sendDateHeader">true</Set> |
---|
265 | <Set name="gracefulShutdown">1000</Set> |
---|
266 | |
---|
267 | </Configure> |
---|