Changes

Jump to navigation Jump to search
27 bytes added ,  13:47, 2 July 2020
Various [[Command-Line_Options#HTTP Server|command-line options]] are available to simplify batch processing. The [[Start_Scripts|start script]] can be adjusted for individual purposes (e.g. if the default memory limit is too restrictive).
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 [httphttps://stackoverflow.com/questions/3521654/missing-jsp-support-in-jetty-or-confusing-log-message can be ignored]):
<syntaxhighlight lang="xml">
==Servlet Container==
In order to deploy BaseX HTTP Services in a servlet container, you can download the WAR distribution of BaseX from the [httphttps://basex.org/download download site], or compile it by calling <code>mvn compile war:war</code> in the <code>basex-api</code> directory. The WAR file can then be deployed following the instructions of the corresponding servlet container ([httphttps://www.eclipse.org/jetty/documentation/current/quickstart-deploying-webapps.html jettyJetty], [httphttps://tomcat.apache.org/tomcat-79.0-doc/deployer-howto.html tomcatTomcat], etc.).
You can configure the port, context path, etc. by following the instructions of the corresponding servlet container. This is needed if you want to replace the default URL path (e.g. http://localhost:8080/rest) with a custom one (e.g. http://localhost:8984/basex/rest).
If you use Jetty (which is the default HTTP server of BaseX), the server configuration is available via the {{Code|jetty.xml}} file, which is stored in the {{Code|WEB-INF}} directory next to the {{Code|web.xml}}. For detailed configuration , refer to the [httphttps://www.eclipse.org/jetty/documentation/current/jetty-xml-config.html Jetty Documentation].
To run on [httphttps://tomcat.apache.org/ Apache Tomcat], start the Tomcat server and add any <code>*.war</code> distribution to deploy via the Tomcat web interface. By default, the interface is accessible via http://localhost:8080/manager/html/.
==Maven==
Check out the BaseX sources via [[Developing with Eclipse|Eclipse]] or [[Git]]. Execute <code>mvn install</code> in the main project directory and then <code>mvn install jetty:run</code> in the <code>basex-api</code> sub-directory. This will start a Jetty instance in which the servlets will be deployed.
The same options as in the case of deployment apply in a servlet container. In this case, however, there is no WAR archive. Instead, Jetty looks up all files in the directory <code>[https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp basex-api/src/main/webapp]</code>. Jetty and servlet options can be configured in the {{Code|jetty.xml}} and {{Code|web.xml}} files as described above in the [[#Configuration|Servlet Container Configuration]]. The Jetty stop port can be changed in the [httphttps://docswww.codehauseclipse.org/displayjetty/JETTYdocumentation/Maven+Jetty+Plugin current/jetty-maven-plugin.html Maven Jetty Plugin] sesion in the {{Code|pom.xml}} file.
=Services=
</syntaxhighlight>
If the HTTP server is started with no pre-defined user, the credentials must be passed on by the client via [httphttps://en.wikipedia.org/wiki/Basic_access_authentication Basic Authentication] or [httphttps://en.wikipedia.org/wiki/Digest_authentication Digest Authentication] (depending on the server setting).
With cURL, internet browsers, and other tools, you can specify basic authentication credentials within the request string as plain text, using the format <code>USER:PASSWORD@URL</code>. An example:
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu