Server Installation and Service » Historie » Revize 7
Revize 6 (Eliška Mourycová, 2021-05-19 14:48) → Revize 7/36 (Roman Kalivoda, 2021-05-26 10:12)
h1. Server Installation (WIP) The server runs on Debian 10 VM at https://nuada.zcu.cz/ The ip of the machine is 147.228.173.54 h2. Hardware requirements TBD, however the default settings for creating the VM seem to suffice h2. Software requirements The server app needs Mono framework to run. Tested on version 5.18.0.240. For mono installetion see *Mono installation*. h2. "Deploying" the Server Application h3. Uploading the project to the remote machine Upload Current approach to uploading the whole folder built with project is to transfer a .zip file containing the commands below: $ scp -r /pathToFolder/publish root@{machine_ip}:/<path>/ You can also upload .exe file and all the default configuration file: dlls needed for the server to run. At the moment that is the Server\ServerApp\bin\x64\Debug directory. $ scp /path/server_config root@{machine_ip}:/<path>/ {dir_name}.zip root@{machine_ip}:/home/someDir h3. Building the project project??? At the moment, the easiest way TBD - wasn't able to build the project is to build it locally in Windows with the following commands: open windows command line (cmd.exe) in the directory where the solution file is located. Please make sure you can run `dotnet` command from the cmd. Make sure you have the right SDK on your system: <pre><code class="text"> dotnet --list-sdks </code></pre> Version 5.0 is needed to build linux yet h4. Mono installation (needed for building as well as running) $ sudo apt install mono-complete h3. Certificate generation and usage h4. Generating the project. If you have certificate http://www.mono-project.com/archived/using-clientcertificates-with-xsp/ In this version, you can build example, the project: <pre><code class="text"> dotnet publish --runtime=linux-x64 ServerApp.sln </code></pre> The built project files are in folder: .\ServerApp\bin\Debug\net5.0\linux-x64\publish named *root.key* and *root.cer*, however they can be called *anything.key/.cer*. h3. Note $ makecert -r -n "CN=My Own Test CA" -sv root.key root.cer The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space. $ certmgr --add -c Trust root.cer h3. Running $ hostname (displays the server machine's host name) Firstly you most grant permission $ makecert -iv root.key -ic root.cer -eku 1.3.6.1.5.5.7.3.1 -n "CN={hostname}" -p12 {hostname}.p12 s3kr3t h4. Linking the certificate to run the executable: a port? $ chmod +x <path>/ServerApp httpcfg -add -port {port} -pvk root.key -cert root.crt Then you can run Current port using the server: cerificate is 10000. $ <path>/ServerApp <args> h4. Adding trusted root certificates to the server (idk if this has any effect) Copy your CA to dir /usr/local/share/ca-certificates/ Use command: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt Update the CA store: sudo update-ca-certificates