Changes

Jump to navigation Jump to search
66 bytes added ,  15:42, 27 February 2020
no edit summary
An instance of the [https://www.eclipse.org/jetty/ Jetty Web Server] will be started, which by default listens to the port {{Code|8984}}. Additionally, the BaseX [[Database Server]] will be started, accessible on port {{Code|1984}}. The command-line output will look something like that (the JSP warning message [http://stackoverflow.com/questions/3521654/missing-jsp-support-in-jetty-or-confusing-log-message can be ignored]):
<pre classsyntaxhighlight lang="brush:xml">
BaseX [HTTP Server]
[main] INFO org.eclipse.jetty.util.log - Logging initialized @375ms to org.eclipse.jetty.util.log.Slf4jLog
HTTP Server was started (port: 8984).
HTTP STOP Server was started (port: 8985).
</presyntaxhighlight>
After startup, you can access an HTML welcome page via http://localhost:8984.
The Jetty logging level can be adjusted by adding the following properties to the start script:
<pre classsyntaxhighlight lang="brush:xml">
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -D{classref}.LEVEL=DEBUG
</presyntaxhighlight>
BaseX can also be deployed as web servlet in a servlet container or with Maven:
All options are prefixed with {{Code|org.basex.}}. Local file paths in options may be absolute or relative. If a relative path is specified, its root will be the servlet’s ({{Code|webapp}}) path:
<pre classsyntaxhighlight lang="brush:xml">
<context-param>
<param-name>org.basex.dbpath</param-name>
<param-value>f:/basex/repository</param-value>
</context-param>
</presyntaxhighlight>
Context parameters can be requested from XQuery via [[Process_Module#proc:property-names|proc:property-names]] and [[Process_Module#proc:property|proc:property]]. How to set these options is specific to the servlet container. For example, in Jetty it can be done by [http://www.eclipse.org/jetty/documentation/current/override-web-xml.html overriding the web.xml] file. Another option is to directly edit the {{Code|WEB-INF/web.xml}} file in the WAR archive (WAR files are simple ZIP files). Refer to the sample [https://github.com/BaseXdb/basex/blob/master/basex-api/src/main/webapp/WEB-INF/web.xml web.xml] of the basex-api package.
Different credentials can be assigned to a service by specifying local init parameters. In the following example, an alternative user is specified for the REST service:
<pre classsyntaxhighlight lang="brush:xml">
<servlet>
<servlet-name>REST</servlet-name>
</init-param>
</servlet>
</presyntaxhighlight>
If the HTTP server is started with no pre-defined user, the credentials must be passed on by the client via [http://en.wikipedia.org/wiki/Basic_access_authentication Basic Authentication] or [http://en.wikipedia.org/wiki/Digest_authentication Digest Authentication] (depending on the server setting).
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu