This topic assumes you have completed the installation steps in Install on Linux. (Windows is no longer supported for new installations.) You may also be using this topic during the upgrade of a system on either Linux or Windows. The mechanisms for editing the respective services differs, as noted below.
Contact your Account Manager for additional guidance when you are using a Premium Edition of LabKey Server.
As a general best practice, review your older configuration files side by side with the new service file to make it easier to selectively migrate necessary settings and values. Note that if you were not using a particular setting previously, you do not need to add it now, even if it appears in our defaults.
The distribution includes an initial "labkey_server.service" file you will use to run your server on Linux, typically from this location:
/etc/systemd/system/labkey_server.service
Customize this file as follows:
-XX:ErrorFile=$LABKEY_HOME/logs/error_%p.log \
If you are using privileged ports, such as 443 for HTTPS, see below for how to grant access to them.
You'll use the distribution's "install_service.bat" file to run the server as a Windows service. The .bat file must be in the same location where you install "prunsrv.exe", typically both will be in:
<LABKEY_HOME>/install_service.bat
<LABKEY_HOME>/prunsrv.exe
Customize the following in your install_service.bat file:
The Tomcat server is run within a Java Virtual Machine (JVM). This JVM that controls the amount of memory available to LabKey Server. LabKey recommends that the Tomcat web application be configured to have a maximum Java Heap size of at least 2GB for a test server, and at least 4GB for a production server. Distributions include service files setting the heap to 2GB. In both cases the HeapDumpOnOutOfMemoryError setting is preconfigured and should not require adjustment.
Administrators will see a banner alerting them if the memory allocation for the server is too low.
To increase the memory allocation, set a higher value for both 'Xms/JvmMs' (amount allocated at startup) and 'Xmx/JvmMx' (max allocation).
-Xms2g -Xmx2g
--JvmMs 2048 ^
--JvmMx 2048
On Linux, ports 1-1023 are "privileged ports". If the service will need access to any such ports, such as for using 443 for HTTPS traffic, set the Ambient Capabilities in the [Service] section:
[Service]
Type=simple
AmbientCapabilities=CAP_NET_BIND_SERVICE
...
There are other methods for providing access, including using setcap.
On a running server, an administrator can confirm intended settings after restarting the server.