Changes

Jump to navigation Jump to search
96 bytes removed ,  16:10, 25 July 2022
=Startup=
{{Announce|With Version 10, the default admin password has been removed, and the default ports have been changed from 8984/8985 to 8080/8081.}}
* Run one of the {{Code|basexhttp}} or {{Code|basexhttp.bat}} scripts. Call the script with the {{Code|stop}} keyword to gracefully shut down the server.
* If you have installed BaseX on ''Windows'', click on the '''BaseX HTTP Server (Start)''' icon.
Various Both an instance of [https://www.eclipse.org/jetty/ Jetty] and BaseX [[Command-Line_Options#HTTP Database Server|command-line options]] are available will be started. By default, Jetty listens to simplify batch processing. The the port 8080, and the [[Start_ScriptsDatabase Server|start scriptBaseX Database Server]] is accessible on port {{Code|1984}}. After startup, you can be adjusted for individual purposes (e.g. if the default memory limit is too restrictive)access a plain HTML welcome page via http://localhost:8080.
An instance of the [https://wwwUnless you have already chosen an admin password yet (e.eclipseg.org/jetty/ Jetty Web Server] will be started, which by default listens to via the port 8080. AdditionallyWindows installer or a previous installation), you can do so by invoking the BaseX [[Database Server]] will be started, accessible on port {{CodeCommand|1984PASSWORD}}. The command-line output will look something like that (the JSP warning message [https://stackoverflow.com/questions/3521654/missing-jsp-support-in-jetty-or-confusing-log-message can be ignored])on your terminal:
<syntaxhighlight lang="xml"pre>basexhttp -c PASSWORD
BaseX [HTTP Server]
[main] INFO org.eclipse.jetty.util.log - Logging initialized @375ms to org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.21.v20190926; built: 2019-09-26T16:41:09.154Z; git: 72970db61a2904371e1218a95a3bef5d79788c33; jvm 13+33
[main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
...
[main] INFO org.eclipse.jetty.util.log - Logging initialized @239ms to org.eclipse.jetty.util.log.Slf4jLog...HTTP STOP Server was started (port: 19848081).
HTTP Server was started (port: 8080).
HTTP STOP Server was started (portPassword: 8081)._</syntaxhighlightpreAfter startup, you can access an HTML welcome page via http://localhost:8080.
The Jetty logging level can be adjusted by adding the following properties to the start script:
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -D{classref}.LEVEL=DEBUG
</syntaxhighlight>
 
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).
BaseX can also be deployed as web servlet in a servlet container or with Maven:
==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-directorysubdirectory. 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 [https://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html Maven Jetty Plugin] sesion in the {{Code|pom.xml}} file.
The following services are available and enabled by default:
{| class="wikitable"
|- valign="top"
! Name
{| class="wikitable"
|-valign="top"
! width="160" | Option
! width="90" |Default
! Description
|-valign="top"
|{{Option|USER}}
|{{Code|admin}}
| If a user is specified, no credentials must be passed on by the client.
|-valign="top"
|{{Option|HTTPLOCAL}}
|{{Code|false}}
|Operation mode. By default, a database server instance will be started, as soon as the first HTTP service is called. The database server can be disabled by setting this flag to {{Code|true}}.
|-valign="top"
|{{Option|RESTXQPATH}}
|{{Code|.}}
|Relative or absolute directory referencing the [[RESTXQ]] modules. By default, the option points to the standard web application directory.
|-valign="top"
|{{Option|RESTPATH}}
|{{Code|.}}
|Relative or absolute directory referencing queries and command-scripts that can be invoked via the [[REST#GET_Requests|run operation]] of REST. By default, the option points to the standard web application directory.
|-valign="top"
|{{Option|AUTHMETHOD}}
|{{Code|Basic}}
==Authentication==
Different No credentials can need to be supplied if a default user is assigned to a service by specifying local init parametersin the {{Code|web.xml}} file. In the following example, an alternative the user {{Code|rest-user }} is specified for the REST service:
<syntaxhighlight lang="xml">
</syntaxhighlight>
If the HTTP server is started with no pre-defined user, the credentials must be passed on by the client via [https://en.wikipedia.org/wiki/Basic_access_authentication Basic Authentication] or [https://en.wikipedia.org/wiki/Digest_authentication Digest Authentication] (, depending on the server setting)chosen authentication method in the configuration.
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:
: <code>http://admin:admin...@localhost:8080/</code>
Users are specified in a {{Code|users.xml}} file, which is stored in the database directory (see [[User Management]] for more information).
;Version 10.0
* Updated: The default admin password has been removed, and the default ports have been changed from 8984/8985 to 8080/8081.
;Version 9.0
;Version 7.3
 
* Updated: {{Code|client}} mode replaced with {{Code|server}} mode
;Version 7.2
 
* Web Application concept revised
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu