Projekt

Obecné

Profil

Server Installation and Service » Historie » Verze 12

Eliška Mourycová, 2021-05-28 09:56

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 12 Eliška Mourycová
47
h3. Note
48
49
The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space.
50
51
h3. Running the server
52
53
* A folder named *data* must exist in the directory where the app is launched
54
* A .p12 file named *cert.p12* must exist in the directory where the app is launched
55
** We used this one: attachment:cert.p12
56
57
Firstly you most grant permission to run the executable:
58
59
<pre>
60
chmod +x <path>/ServerApp
61
</pre>
62
63
Then you can run the server:
64
65
<pre>
66
<path>/ServerApp <args>
67
</pre>
68
69
70
71 1 Eliška Mourycová
---
72 11 Eliška Mourycová
73 1 Eliška Mourycová
h3. Certificate generation and usage (DEPRECATED)
74 11 Eliška Mourycová
75 1 Eliška Mourycová
This section provides instructions for generating and using a certificate with a secific port.
76 12 Eliška Mourycová
*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.
77
* Follow these steps if the above stated instructions didn't work as expected.
78 1 Eliška Mourycová
79 12 Eliška Mourycová
h4. Mono installation
80
81
<pre>
82
sudo apt install mono-complete
83
</pre>
84
85
86 11 Eliška Mourycová
h4. Generating the certificate
87
88
http://www.mono-project.com/archived/using-clientcertificates-with-xsp/
89 7 Roman Kalivoda
90 2 Eliška Mourycová
<pre>
91 1 Eliška Mourycová
makecert -r -n "CN=My Own Test CA" -sv root.key root.cer
92
certmgr --add -c Trust root.cer
93 9 Eliška Mourycová
hostname (displays the machine's host name)
94
makecert -iv root.key -ic root.cer -eku 1.3.6.1.5.5.7.3.1 -n "CN={hostname}" -p12 {hostname}.p12 s3kr3t
95 1 Eliška Mourycová
</pre>
96 10 Eliška Mourycová
97 1 Eliška Mourycová
h4. Linking the certificate to a port?
98 9 Eliška Mourycová
99 7 Roman Kalivoda
<pre>
100 2 Eliška Mourycová
httpcfg -add -port {port} -pvk root.key -cert root.crt
101 8 Eliška Mourycová
</pre>
102 11 Eliška Mourycová
103 8 Eliška Mourycová
h4. Adding trusted root certificates to the server (idk if this has any effect)
104 2 Eliška Mourycová
105 8 Eliška Mourycová
Copy your CA to dir /usr/local/share/ca-certificates/
106 7 Roman Kalivoda
Use command: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt
107 8 Eliška Mourycová
Update the CA store: sudo update-ca-certificates
108 11 Eliška Mourycová
109 8 Eliška Mourycová
---