=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.
Both an instance of [https://www.eclipse.org/jetty/ Jetty] and BaseX [[Database Server]] will be started. By default, Jetty listens to the port 8080, and the [[Database Server|BaseX Database Server]] is accessible on port {{Code|1984}}. After startup, you can access a plain HTML welcome page via http://localhost:8080.
Unless you have already chosen an admin password yet (e.g., via the Windows installer or a previous installation), you can do so by invoking the {{Command|PASSWORD}} command on your terminal:
The Jetty logging level can be adjusted by adding the following properties to the start script:
<syntaxhighlight pre lang="xml">
-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -D{classref}.LEVEL=DEBUG
</syntaxhighlightpre>
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).
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:8080/basex/rest).
If you use Jetty (which is the default HTTP server of BaseX), the server configuration is available via defined in 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 [https://www.eclipse.org/jetty/documentation/current/jetty-xml-config.html Jetty Documentation].
To run on [https://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/.
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:
<syntaxhighlight pre lang="xml">
<context-param>
<param-name>org.basex.dbpath</param-name>
<param-value>f:/basex/repository</param-value>
</context-param>
</syntaxhighlightpre>
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 {{Code|basex-api }} package.
To enable or disable a specific service, the corresponding servlet entry in the {{Code|web.xml}} file needs to be removed/commented.
No credentials need to be supplied if a default user is assigned to a service in the {{Code|web.xml}} file. In the following example, the user {{Code|rest-user}} is specified for the REST service:
<syntaxhighlight pre lang="xml">
<servlet>
<servlet-name>REST</servlet-name>
</init-param>
</servlet>
</syntaxhighlightpre>
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 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 8.6
* Updated: Authentication readded re-added to RESTXQ.
* Updated: No password must be specified in the <code>web.xml</code> file anymore.
* Updated: Server-side user and authentication method is now enforced (cannot be overwritten by client).