# 4 Installation¶

## 4.1 Requirements¶

The following are prerequisites to run OptServer:

• OptServer is only available for 64bit Linux.
• MOSEK binaries are required. If the OptServer is installed from a standard MOSEK distribution, then it will naturally contain the necessary files, however an external MOSEK installation can also be used.

## 4.2 Locating files¶

The relevant files of the Optimization Server are organized as reported below

Table 4.1 Relevant files for the Optimization Server.
Relative Path Description
<MSKHOME>/mosek/9.2/opt-server/bin Scripts and binaries
<MSKHOME>/mosek/9.2/opt-server/etc Configuration files and certificates
<MSKHOME>/mosek/9.2/opt-server/var Runtime directory, Web interface

where <MSKHOME> is the folder in which the MOSEK Optimization Suite has been installed.

## 4.3 Installation¶

To install OptServer and test the installation perform the following steps.

### 4.3.1 Run install script¶

Run the script <MSKHOME>/mosek/9.2/opt-server/bin/install_MosekServer to configure the server. The full list of supported options can be obtained via

./install_MosekServer --help

As a reasonable minimum the configuration should specify where to install the server, the port to listen on, the database connection string and the location of an available MOSEK installation. For example:

./install_MosekServer --inplace \
--port $PORT \ --mosekdir ../../.. \ --database-resource "host=/var/run/postgresql user=$USER dbname=$DBNAME sslmode=disable" The install script creates a configuration file <MSKHOME>/mosek/9.2/opt-server/etc/Mosek/server.conf which can be edited by hand if necessary. ### 4.3.2 Initialize the database¶ Run ./MosekServer --create-database to initialize the database. It will use the information provided in the database connection string specified in the previous step. This step is not necessary if the database exists from a previous installation. ### 4.3.3 Initialize admin password (optional)¶ If the Web interface to the OptServer is to be used, run ./MosekServer --reset-admin to set the password for the admin user. This step is not required if the Web GUI will not be used. Note that the GUI will only be available with SSL enabled, see Sec. 6.3 (Security). ### 4.3.4 Run the server¶ Start the server by running the script ./MosekServer The server will print its initial configuration and continue writing the log to a file. To obtain the full list of server options run ./MosekServer --help For debugging purposes it is convenient to use the options ./MosekServer --debug --logfile - This will increase the amount of debug output and redirect it to standard output. ### 4.3.5 Test the installation¶ To test that the OptServer is working properly locate, compile (if necessary) and run the example opt_server_sync.* for either C, Python, Java or C#. Examples and sample data files can be found in the distribution package under <MSKHOME>/mosek/9.2/tools/examples. For example, assuming that MOSEK was installed in Python, one can go to the folder with Python examples and run python opt_server_sync.py ../data/25fv47.mps$SERVER $PORT where$SERVER:\$PORT points to the OptServer. If the configuration is correct the example will print a log from solving the problem and a solution summary. In case of issues the log output of the OptServer should be consulted to determine the cause.

This example also demonstrates how to use the OptServer from the MOSEK API.