Server Installation and Service » Historie » Verze 11
Eliška Mourycová, 2021-05-28 08:06
1 | 1 | Eliška Mourycová | h1. Server Installation (WIP) |
---|---|---|---|
2 | |||
3 | The server runs on Debian 10 VM at https://nuada.zcu.cz/ |
||
4 | 3 | Eliška Mourycová | The ip of the machine is 147.228.173.54 |
5 | 1 | Eliška Mourycová | |
6 | h2. Hardware requirements |
||
7 | 3 | Eliška Mourycová | |
8 | TBD, however the default settings for creating the VM seem to suffice |
||
9 | |||
10 | h2. Software requirements |
||
11 | |||
12 | 4 | Eliška Mourycová | |
13 | 1 | Eliška Mourycová | h2. "Deploying" the Server Application |
14 | |||
15 | h3. Uploading the project to the remote machine |
||
16 | |||
17 | 7 | Roman Kalivoda | Upload the whole folder built with the commands below: |
18 | 1 | Eliška Mourycová | |
19 | 8 | Eliška Mourycová | <pre> |
20 | 11 | Eliška Mourycová | scp -r /pathToFolder/publish root@{machine_ip}:/<path>/ |
21 | 8 | Eliška Mourycová | </pre> |
22 | 1 | Eliška Mourycová | |
23 | 7 | Roman Kalivoda | You can also upload the default configuration file: |
24 | 1 | Eliška Mourycová | |
25 | 8 | Eliška Mourycová | <pre> |
26 | 11 | Eliška Mourycová | scp /path/server_config root@{machine_ip}:/<path>/ |
27 | 8 | Eliška Mourycová | </pre> |
28 | 1 | Eliška Mourycová | |
29 | 7 | Roman Kalivoda | h3. Building the project |
30 | 1 | Eliška Mourycová | |
31 | At the moment, the easiest way to build the project is to build it locally in Windows with the following commands: |
||
32 | 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: |
||
33 | 11 | Eliška Mourycová | <pre> |
34 | dotnet --list-sdks |
||
35 | </pre> |
||
36 | |||
37 | 7 | Roman Kalivoda | Version 5.0 is needed to build the project. If you have this version, you can build the project: |
38 | 11 | Eliška Mourycová | |
39 | <pre> |
||
40 | dotnet publish --runtime=linux-x64 ServerApp.sln |
||
41 | </pre> |
||
42 | |||
43 | 1 | Eliška Mourycová | The built project files are in folder: |
44 | .\ServerApp\bin\Debug\net5.0\linux-x64\publish |
||
45 | |||
46 | 11 | Eliška Mourycová | --- |
47 | 1 | Eliška Mourycová | |
48 | 11 | Eliška Mourycová | h3. Certificate generation and usage (DEPRECATED) |
49 | 1 | Eliška Mourycová | |
50 | 11 | Eliška Mourycová | This section provides instructions for generating and using a certificate with a secific port. |
51 | *Important note*: this approach was used when the server application ran under the Mono framework. Mono is no longer used for running the application as it was unable to use some needed libraries |
||
52 | |||
53 | h4. Generating the certificate |
||
54 | |||
55 | http://www.mono-project.com/archived/using-clientcertificates-with-xsp/ |
||
56 | |||
57 | <pre> |
||
58 | makecert -r -n "CN=My Own Test CA" -sv root.key root.cer |
||
59 | certmgr --add -c Trust root.cer |
||
60 | hostname (displays the machine's host name) |
||
61 | makecert -iv root.key -ic root.cer -eku 1.3.6.1.5.5.7.3.1 -n "CN={hostname}" -p12 {hostname}.p12 s3kr3t |
||
62 | </pre> |
||
63 | |||
64 | h4. Linking the certificate to a port? |
||
65 | |||
66 | <pre> |
||
67 | httpcfg -add -port {port} -pvk root.key -cert root.crt |
||
68 | </pre> |
||
69 | |||
70 | h4. Adding trusted root certificates to the server (idk if this has any effect) |
||
71 | |||
72 | Copy your CA to dir /usr/local/share/ca-certificates/ |
||
73 | Use command: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt |
||
74 | Update the CA store: sudo update-ca-certificates |
||
75 | |||
76 | --- |
||
77 | |||
78 | 7 | Roman Kalivoda | h3. Note |
79 | 2 | Eliška Mourycová | |
80 | 1 | Eliška Mourycová | The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space. |
81 | |||
82 | 9 | Eliška Mourycová | h3. Running the server |
83 | |||
84 | 1 | Eliška Mourycová | * A folder named *data* must exist in the directory where the app is launched |
85 | 10 | Eliška Mourycová | * A .p12 file named *cert.p12* must exist in the directory where the app is launched |
86 | 1 | Eliška Mourycová | ** We used this one: attachment:cert.p12 |
87 | 9 | Eliška Mourycová | |
88 | 7 | Roman Kalivoda | Firstly you most grant permission to run the executable: |
89 | 2 | Eliška Mourycová | |
90 | 8 | Eliška Mourycová | <pre> |
91 | 11 | Eliška Mourycová | chmod +x <path>/ServerApp |
92 | 8 | Eliška Mourycová | </pre> |
93 | 2 | Eliška Mourycová | |
94 | 8 | Eliška Mourycová | Then you can run the server: |
95 | 7 | Roman Kalivoda | |
96 | 8 | Eliška Mourycová | <pre> |
97 | 11 | Eliška Mourycová | <path>/ServerApp <args> |
98 | 8 | Eliška Mourycová | </pre> |