Changes

Jump to navigation Jump to search
3,299 bytes added ,  16:15, 18 March 2012
Initial version of BaseX HTTP Services
BaseX provides access to stored database resources and to the XQuery engine via [[REST]], [[RESTXQ]] and [[WebDAV]] services. This article describes different way of deploying and configuring these services. The services can be deployed in 3 different ways: as a standalone application, as web servlets in a J2EE servlet container, and for development purposes, using maven.

=Standalone: BaseX HTTP Server=
Detailed description how to start and setup the HTTP server can found under [[Startup#BaseX HTTP Server|Startup: BaseX HTTP Server]] and [[Startup_Options#BaseX_HTTP_Server|Startup Options: BaseX HTTP Server]].

=Servlet Container=

In order to deploy BaseX HTTP Services in a servlet container, one needs to download the WAR distribution of BaseX from the [http://basex.org/products/download/all-downloads download site]. The downloaded WAR file can be then deployed following the instructions of the corresponding servlet container.

==Servlet Container Configuration==
Configuring port, context path, etc. can be done following the corresponding instructions of the used servlet container.

==Configuring Available Services==
To enable or disable one of the provided services, the corresponding servlet entry in the {{Mono|web.xml}} file needs to be removed/commented.

==Configuring Database Access==
The following options are available to configure the way the databases are accessed. These can be set in the {{Mono|web.xml}} file or as Java system variables (e.g. using <code>-Dorg.basex.path="/some/path"</code> from the command line).
{| class="wikitable"
|- valign="top"
! width='70' | Option
! Description
|- valign="top"
| {{Mono|org.basex.path}}
| Path to the BaseX home directory, in which the {{Mono|.basex}} configuration file will be placed. By default, no value is specified; as a result, the default servlet context path will be used.
|- valign="top"
| {{Mono|org.basex.mode}}
| Operation mode. By default, the value is "{{Mono|local}}": a new BaseX instance will be created and used for all operations. If "{{Mono|client}}" is specified, all operations are performed on a remote server instance (the login data of which is stored in the {{Mono|.basex}} configuration file).
|- valign="top"
| {{Mono|org.basex.user}}
| Database user. By default, no value is specified, and the credentials must be specified by the client. Note that it is a clear security risk to store user credentials in the {{Mono|web.xml}} file. The default user credentials can be found under [[Startup#BaseX_Client|Startup: BaseX Client]].
|- valign="top"
| {{Mono|org.basex.password}}
| Database user password.
|}

=Maven=

Checkout the sources of basex and basex-api as described under [[Integrate#Check_Out|Integrate: Check Out]]. Execute <code>mvn install</code> in the basex project folder and then <code>mvn install jetty:run</code> in the basex-api project folder. This will start a Jetty instance in which the servlets will be deployed.

==Configuration==
The same options as in the case of deployment in a servlet container apply. For configuring various Jetty runtime options, such as port, context path, etc. refer to the [http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin Maven Jetty Plugin].

[[Category:Server]]
[[Category:REST]]
[[Category:Developer]]
[[Category:Instructions]]
administrator, Bureaucrats, editor, reviewer, Administrators
98

edits

Navigation menu