wt_config.xml.in 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <!--
  2. Wt Configuration File.
  3. The Wt configuration file manages, for every Wt application, settings
  4. for session management, debugging, directory for runtime information
  5. such as session sockets, and some security settings.
  6. Settings may be specified globally, or for a single application path.
  7. The path should be as configured in the Wt build process, where it
  8. defaults to /etc/wt/wt_config.xml. It can be overridden in the environment
  9. variable WT_CONFIG_XML, or with the -c startup option of wthttp.
  10. The values listed here are the default values, which are used when the
  11. declaration is missing or no configuration file is used.
  12. -->
  13. <server>
  14. <!-- Default application settings
  15. The special location "*" always matches. See below for an example
  16. of settings specific to a single application.
  17. -->
  18. <application-settings location="*">
  19. <!-- Session management. -->
  20. <session-management>
  21. <!-- Every session runs within a dedicated process.
  22. This mode guarantees kernel-level session privacy, but as every
  23. session requires a seperate process, it is also an easy target
  24. for DoS attacks if not shielded by access control.
  25. Note: currently only supported by the wtfcgi and wthttp
  26. connectors.
  27. -->
  28. <!--
  29. <dedicated-process>
  30. <max-num-sessions>100</max-num-sessions>
  31. </dedicated-process>
  32. -->
  33. <!-- Multiple sessions within one process.
  34. This mode spawns a number of processes, and sessions are
  35. allocated randomly to one of these processes (you should not
  36. use this for dynamic FCGI servers, but only in conjunction
  37. with a fixed number of static FCGI servers.
  38. This requires careful programming, as memory corruption in one
  39. session will kill all of the sessions in the same process. You
  40. should debug extensively using valgrind. Also, it is your
  41. responsibility to keep session state not interfering and
  42. seperated.
  43. On the other hand, sessions are inexpensive, and this mode
  44. suffers far less from DoS attacks than dedicated-process mode.
  45. Use it for non-critical and well-debugged web applications.
  46. Note: the wthttp connector will ignore the num-processes
  47. setting and use only process.
  48. -->
  49. <shared-process>
  50. <num-processes>1</num-processes>
  51. </shared-process>
  52. <!-- Session tracking strategy.
  53. Possible values:
  54. Auto: cookies if available, otherwise URL rewriting
  55. URL: only URL rewriting
  56. Combined: uses URL rewriting, with a multi-session cookie to
  57. prevent stealing of sessions through the URL. Will
  58. not fall back to URL rewriting if cookies are not
  59. available. This is the most secure strategy.
  60. It is recommended to stick to URL rewriting or Combined for session
  61. tracking as this is more secure (it avoids the risk of attacks
  62. like CSRF or BREACH), and also provides proper support for
  63. concurrent sessions in a single browser.
  64. -->
  65. <tracking>URL</tracking>
  66. <!-- How reload should be handled.
  67. When reload should (or rather, may) spawn a new session, then
  68. even in the case cookies are not used for session management,
  69. the URL will not be cluttered with a sessionid.
  70. However, WApplication::refresh() will never be called.
  71. -->
  72. <reload-is-new-session>true</reload-is-new-session>
  73. <!-- Session timeout (seconds).
  74. When a session remains inactive for this amount of time, it is
  75. cleaned up.
  76. -->
  77. <timeout>600</timeout>
  78. <!-- Server push timeout (seconds).
  79. When using server-initiated updates, the client uses
  80. long-polling requests. Proxies (including reverse
  81. proxies) are notorious for silently closing idle
  82. requests; the client therefore cancels the request
  83. periodically and issues a new one. This timeout sets
  84. the frequency.
  85. -->
  86. <server-push-timeout>50</server-push-timeout>
  87. </session-management>
  88. <!-- Settings that apply only to the FastCGI connector.
  89. To configure the wthttp connector, use command line options, or
  90. configure default options in /etc/wt/wthttpd
  91. -->
  92. <connector-fcgi>
  93. <!-- Valgrind path
  94. If debugging is enabled and this path is not empty, then valgrind
  95. will be started for every shared process, or for every session
  96. which has ?debug appended to the command line.
  97. The variable is slighly misnamed. Not only a path can be set,
  98. but also options, like for example:
  99. /usr/bin/valgrind - -leak-check=full
  100. -->
  101. <valgrind-path></valgrind-path>
  102. <!-- Run directory
  103. Path used by Wt to do session management.
  104. -->
  105. <run-directory>${RUNDIR}</run-directory>
  106. <!-- Number of threads per process
  107. This configures the size of the thread pool. You may
  108. want to change this value if you would like to support
  109. reentrant event loops, where you block one event loop
  110. using WDialog::exec() or related static
  111. methods. Everytime you enter such an event loop, one
  112. thread is blocked, and therefore the total number of
  113. sessions that reliably can do this is limited to the
  114. number of thread you have (minus one to unblock).
  115. For the built-in http connector, there is a similar
  116. config option that is specified in the whttpd config
  117. file or on the command line (-t).
  118. The default value is 1.
  119. -->
  120. <num-threads>1</num-threads>
  121. </connector-fcgi>
  122. <!-- Settings that apply only to the MS IIS ISAPI connector.
  123. To configure the wthttp connector, use command line options, or
  124. configure default options in /etc/wt/wthttpd
  125. -->
  126. <connector-isapi>
  127. <!-- Number of threads per process
  128. This configures the number of threads that will be used
  129. to handle Wt requests. The IIS internal threads are never
  130. used to do any processing; all requests are forwarded to
  131. be handled in this threadpool. Rather than to configure a
  132. so-called 'web-garden' in IIS, increase this number. The
  133. ISAPI connector will not work correctly when a web-garden
  134. is configured.
  135. You may want to change this value if you would like to
  136. support more reentrant event loops, where you block one
  137. event loop using WDialog::exec() or related static
  138. methods. Everytime you enter such an event loop, one
  139. thread is blocked, and therefore the total number of
  140. sessions that reliably can do this is limited to the
  141. number of thread you have (minus one to unblock).
  142. You may also want to increase this number if your Wt
  143. application is regularly waiting for IO (databases, network,
  144. files, ...). If this number is too low, all threads could
  145. be waiting for IO operations to complete while your CPU
  146. is idle. Increasing the number of threads may help.
  147. Computing intensive applications may also increase this number,
  148. even though it is better to offload computations to a helper
  149. thread and user server push or a WTimer to check for
  150. completion of the task in order to keep your GUI responsive
  151. during the computations.
  152. The default value is 10.
  153. -->
  154. <num-threads>10</num-threads>
  155. <!-- Maximum Request Size spooled in memory (Kb)
  156. Normally, Wt keeps incoming requests (POST data) in memory.
  157. However, malicious users could send a big POST and as such
  158. use up all memory of your HTTP server. With this parameter,
  159. you tune how big a request can be before Wt spools it in a
  160. file before processing it. Legitimate big POST messages may
  161. occur when users are expected to upload files.
  162. See also max-request-size.
  163. The default value is 128K, which is more than enough for
  164. any interactive Wt event.
  165. -->
  166. <max-memory-request-size>128</max-memory-request-size>
  167. </connector-isapi>
  168. <!-- Javascript debug options
  169. Values:
  170. - naked: JavaScript errors are not caught at all
  171. - false: JavaScript errors are caught and a simple error message
  172. is printed to indicate that something is terribly wrong
  173. - stack: equivalent to 'false'
  174. - true: JavaScript errors are rethrown after server-side logging
  175. Unless the value is 'naked',
  176. WApplication::handleJavaScriptError() is called which by
  177. default logs the error and terminates the session.
  178. -->
  179. <debug>false</debug>
  180. <!-- Log file
  181. When the log file is empty, or omitted, logging is done to
  182. stderr. This may end up in the web server error log file
  183. (e.g. for apache + fastcgi module), or on stderr (e.g. for
  184. the built-in httpd).
  185. -->
  186. <log-file></log-file>
  187. <!-- Logger configuration
  188. This configures the logger. With the default configuration,
  189. everything except for debugging messages are logged.
  190. The configuration is a string that defines rules for
  191. enabling or disabling certain logging. It is a white-space
  192. delimited list of rules, and each rule is of the form:
  193. [-]level : enables (or disables) logging of messages of
  194. the given level; '*' is a wild-card that matches all
  195. levels
  196. [-]level:scope : enables (or disables) logging of
  197. messages of the given level and scope; '*' is a wild-card
  198. that matches all levels or scopes. The default
  199. configuration is "* -debug", i.e. by default everything
  200. is logged, except for "debug" messages.
  201. Some other examples:
  202. "* -debug debug:wthttp": logs everything, including
  203. debugging messages of scope "wthttp", but no other
  204. debugging messages.
  205. "* -info -debug": disables logging of info messages
  206. in addition to debugging messages.
  207. Note debugging messages are only emitted when debugging
  208. has been enabled while building Wt.
  209. -->
  210. <log-config>* -debug</log-config>
  211. <!-- Maximum HTTP request size (Kb)
  212. Maximum size of an incoming POST request. This value must be
  213. increased when the user is allowed to upload files.
  214. -->
  215. <max-request-size>128</max-request-size>
  216. <!-- Session id length (number of characters) -->
  217. <session-id-length>16</session-id-length>
  218. <!-- DoS prevention: limit plain HTML sessions
  219. This is a simple measure which avoids Denial-of-Service
  220. attacks on plain HTML sessions, which are easy to mount in
  221. particular in the case of progressive bootstrap mode.
  222. This setting may be used to keep the ratio of plain HTML
  223. versus Ajax sessions under a certain ratio. Typically, most
  224. of your sessions will be Ajax sessions, and only a tiny
  225. fraction (e.g. less than 5%) will be plain HTML
  226. sessions. This ratio is only enforced when more than 20 sessions
  227. have been created.
  228. -->
  229. <plain-ajax-sessions-ratio-limit>1</plain-ajax-sessions-ratio-limit>
  230. <!-- DoS prevention: adds a puzzle to validate Ajax sessions
  231. This is a simple measure which avoids Denial-of-Service
  232. attacks on Ajax sessions.
  233. When enabled, a puzzle needs to be solved in the first Ajax
  234. request which eliminates agents that do not build a proper
  235. DOM tree.
  236. -->
  237. <ajax-puzzle>false</ajax-puzzle>
  238. <!-- Do strict serialization of events.
  239. By default events are queued at the client-side, and
  240. transmitted to the server so that at any time only one
  241. request/response is pending. This scheme has a quality that
  242. resembles TCP: on a low-latency link you allow the
  243. transmission of many smaller requests, while on a high
  244. latency link, events will be propagated less often, but in
  245. batches.
  246. In any case, this scheme does not drop events, no matter
  247. how quickly they are generated.
  248. In rare cases, the scheme may result in unwanted behaviour,
  249. because the client-side is allowed to be slighly out of
  250. sync at the time an event is recorded with the server-side
  251. (and more so on high-latency links). The drastic
  252. alternative is to discard events while a response is
  253. pending, and can be configured by setting this option to
  254. true.
  255. -->
  256. <strict-event-serialization>false</strict-event-serialization>
  257. <!-- Enables web socket.
  258. By default Ajax and long polling are used to communicate
  259. between server and browser.
  260. By enabling web socket support, if the browser supports
  261. WebSockets, then WebSocket is the protocol used for
  262. communication between client and server. WebSockets are
  263. currently only supported by the built-in httpd Connector,
  264. which acts as both an HTTP and WebSocket server. The WebSocket
  265. protocol is intentionally not compatible with HTTP, through
  266. a special hand-shake mechanism, and requires
  267. that all (reverse) proxy servers also have explicit support
  268. for this protocol.
  269. -->
  270. <web-sockets>false</web-sockets>
  271. <!-- Enables the detection of webgl-capabilites.
  272. When this is enabled, the browser will try to create a
  273. webgl-context when loading to verify that it is possible. This
  274. is necessary when using WGLWidget.
  275. This can take up some load time. When your application does not
  276. use WGLWidget, this option can be set to false. It will improve
  277. the initial loading time of the web application.
  278. -->
  279. <webgl-detection>true</webgl-detection>
  280. <!-- Redirect message shown for browsers without JavaScript support
  281. By default, Wt will use an automatic redirect to start the
  282. application when the browser does not support
  283. JavaScript. However, browsers are not required to follow
  284. the redirection, and in some situations (when using XHTML),
  285. such automatic redirection is not supported.
  286. This configures the text that is shown in the anchor which
  287. the user may click to be redirected to a basic HTML version
  288. of your application.
  289. -->
  290. <redirect-message>Load basic HTML</redirect-message>
  291. <!-- Whether we are sitting behind a reverse proxy
  292. When deployed behind a reverse proxy (such as Apache or Squid),
  293. the server location is not read from the "Host" header,
  294. but from the X-Forwarded-For header, if present.
  295. This option is required to make e.g. clientAddress() return the
  296. correct address.
  297. -->
  298. <behind-reverse-proxy>false</behind-reverse-proxy>
  299. <!-- Whether inline CSS is allowed.
  300. Some Wt widgets will insert CSS rules in the the inline
  301. stylesheet when first used. This can be disabled using this
  302. configuration option.
  303. Note: some widgets, such as WTreeView and WTableView,
  304. dynamically manipulate rules in this stylesheet, and will
  305. no longer work properly when inline-css is disabled.
  306. -->
  307. <inline-css>true</inline-css>
  308. <!-- The timeout before showing the loading indicator.
  309. The value is specified in ms.
  310. -->
  311. <indicator-timeout>500</indicator-timeout>
  312. <!-- The timeout for processing a double click event.
  313. The value is specified in ms.
  314. -->
  315. <double-click-timeout>200</double-click-timeout>
  316. <!-- Ajax user agent list
  317. Wt considers three types of sessions:
  318. - Ajax sessions: use Ajax and JavaScript
  319. - plain HTML sessions: use plain old server GETs and POSTs
  320. - bots: have clean internal paths and no persistent sessions
  321. By default, Wt does a browser detection to distinguish between
  322. the first two: if a browser supports JavaScript (and has it
  323. enabled), and has an Ajax DOM API, then Ajax sessions are chosen,
  324. otherwise plain HTML sessions.
  325. Here, you may indicate which user agents should or should
  326. not receive an Ajax session regardless of what they report as
  327. capabilities.
  328. Possible values for 'mode' or "white-list" or "black-list". A
  329. white-list will only treat the listed agents as supporting Ajax,
  330. all other agents will be served plain HTML sessions. A black-list
  331. will always server plain HTML sessions to listed agents and
  332. otherwise rely on browser capability detection.
  333. Each <user-agent> is a regular expression.
  334. -->
  335. <user-agents type="ajax" mode="black-list">
  336. <!-- <user-agent>.*Crappy browser.*</user-agent> -->
  337. </user-agents>
  338. <!-- Bot user agent list
  339. Here, you can specify user agents that should be should be
  340. treated as bots.
  341. Each <user-agent> is a regular expression.
  342. -->
  343. <user-agents type="bot">
  344. <user-agent>.*Googlebot.*</user-agent>
  345. <user-agent>.*msnbot.*</user-agent>
  346. <user-agent>.*Slurp.*</user-agent>
  347. <user-agent>.*Crawler.*</user-agent>
  348. <user-agent>.*Bot.*</user-agent>
  349. <user-agent>.*ia_archiver.*</user-agent>
  350. <user-agent>.*Twiceler.*</user-agent>
  351. </user-agents>
  352. <!-- Configures different rendering engines for certain browsers.
  353. Currently this is only used to select IE7 compatible rendering
  354. engine for IE8, which solves problems of unreliable and slow
  355. rendering performance for VML which Microsoft broke in IE8.
  356. Before 3.3.0, the default value was IE8=IE7, but since 3.3.0
  357. this has been changed to an empty string (i.e. let IE8 use the
  358. standard IE8 rendering engine) to take advantage of IE8's
  359. improved CSS support. If you make heavy use of VML, you may need
  360. to revert to IE8=IE7.
  361. -->
  362. <UA-Compatible></UA-Compatible>
  363. <!-- Configures whether the progressive bootstrap method is used.
  364. The default bootstrap method first senses whether there is Ajax
  365. support, and only then creates the application.
  366. The progressive bootstrap method first renders a plain HTML
  367. version and later upgrades to an Ajax version.
  368. (Not to be confused with the Twitter Bootstrap theme)
  369. -->
  370. <progressive-bootstrap>false</progressive-bootstrap>
  371. <!-- Set session-ID cookie
  372. In its default (and recommended) configuration, Wt does not
  373. rely on cookies for session tracking.
  374. Wt has several mechanisms in place to prevent session ID stealing:
  375. - for an Ajax session, the session ID is not shown in the URL,
  376. avoiding session ID stealing through a referer attack.
  377. - in case the session ID is present in the URL (e.g. for a plain
  378. HTML session), Wt will redirect links to images or external
  379. anchors through an intermediate page that censors the session ID
  380. In case of the loss of a session ID, the impact is minimized:
  381. - a full page refresh is not supported if the client IP address
  382. changes or the user-agent changes
  383. - an Ajax update is protected by other state which is not exposed
  384. in the URL
  385. To still enable a full page refresh when the client IP address
  386. changes, an additional cookie may be set which is used only
  387. for this purpose, and can be enabled using this setting.
  388. -->
  389. <session-id-cookie>false</session-id-cookie>
  390. <!-- Configure cookie checks
  391. By default, Wt will test for cookie support using JavaScript.
  392. Because cookie manipulation from JavaScript is a common security
  393. risk vector, some prefer to disable these checks.
  394. -->
  395. <cookie-checks>true</cookie-checks>
  396. <!-- Configure meta headers
  397. The user-agent allows optional filtering based on the
  398. user-agent, using a regular expression. You can have multiple
  399. set-meta-headers definitions.
  400. -->
  401. <meta-headers user-agent=".*MSIE.*">
  402. <meta name="robots" content="noindex" />
  403. </meta-headers>
  404. <!-- Runtime Properties
  405. These properties may be used to adapt applications to their
  406. deployment environment. Typical use is for paths to resources
  407. that may or may not be shared between several applications.
  408. -->
  409. <properties>
  410. <!-- baseURL property
  411. The absolute URL at which the application is deployed
  412. (known to the user). This is needed only in two scenarios.
  413. a) use of relative URLs in included XHTML
  414. When you use relative URLs for images, etc... in
  415. literal XHTML fragments (e.g. in WTemplate), which need
  416. to resolve against the deployment path of the
  417. application. This will not work as expected in the
  418. presence of an internal application path. This URL is
  419. set as base URL in the HTML, against which relative
  420. URLs are resolved so that these work correctly
  421. regardless of the internal path. It is also used
  422. explicitly in any URL generated by the library.
  423. b) widgetset mode deployments
  424. Another situation in which you need to define the baseURL is
  425. when deploying a widgetset mode application behind a reverse
  426. proxy. A widgetset mode application uses only absolute URLs
  427. because it may be hosted in a web page from an entirely
  428. different domain.
  429. By default, no baseURL is specified, in which case Wt will
  430. avoid using absolute URLs. Relative URLs passed in API calls
  431. will be "fixed" so that they resolve against the location of the
  432. application deploy path, even in the presence of an
  433. internal path.
  434. -->
  435. <!-- <property name="baseURL">"http://mysite.com/app</property> -->
  436. <!-- resourcesURL property
  437. The URL at which the resources/ folder is deployed that
  438. comes distributed with Wt and contains auxiliary files
  439. used to primarily for styles and themes.
  440. The default value is 'resources/'
  441. -->
  442. <property name="resourcesURL">resources/</property>
  443. <!-- extBaseURL property
  444. Used in conjunction with Ext:: widgets, and points to the
  445. URL of Ext JavaScript and resource files (css, images).
  446. See the documentation for the Ext namespace for details.
  447. The default value is 'ext/'
  448. -->
  449. <property name="extBaseURL">ext/</property>
  450. <!-- favicon property
  451. By default, a browser will try to fetch a /favicon.ico icon
  452. from the root of your web server which is used as an icon
  453. for your application. You can specify an alternative location
  454. by setting this property, or for an individual application
  455. entry point by passing a location to WServer::addEntryPoint().
  456. -->
  457. <!-- <property name="favicon">images/favicon.ico</property> -->
  458. </properties>
  459. </application-settings>
  460. <!-- Override settings for specific applications.
  461. Location refers to physical filesystem location of the
  462. application. The application prints this location (which
  463. corresponds to argv[0]) to the log file on startup, and this
  464. should match exactly.
  465. -->
  466. <!--
  467. <application-settings
  468. location="/var/www/localhost/wt-examples/hello.wt">
  469. </application-settings>
  470. -->
  471. </server>