Projekt

Obecné

Profil

Server Installation and Service » Historie » Verze 14

Eliška Mourycová, 2021-05-28 10:05

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 13 Eliška Mourycová
The application was tested on a machine with the following specs:
7
8 3 Eliška Mourycová
h2. Hardware requirements
9 1 Eliška Mourycová
10 13 Eliška Mourycová
* RAM size
11
* Disk size
12
* Processor architecture
13 1 Eliška Mourycová
14 13 Eliška Mourycová
15 3 Eliška Mourycová
h2. Software requirements
16 1 Eliška Mourycová
17 13 Eliška Mourycová
* OS, OS version
18 14 Eliška Mourycová
* -Mono, version 5.18.0.240-
19 4 Eliška Mourycová
20 1 Eliška Mourycová
h2. "Deploying" the Server Application
21
22
h3. Uploading the project to the remote machine
23
24 7 Roman Kalivoda
Upload the whole folder built with the commands below:
25 1 Eliška Mourycová
26 8 Eliška Mourycová
<pre>
27 11 Eliška Mourycová
scp -r /pathToFolder/publish root@{machine_ip}:/<path>/
28 8 Eliška Mourycová
</pre>
29 1 Eliška Mourycová
30 7 Roman Kalivoda
You can also upload the default configuration file:
31 1 Eliška Mourycová
32 8 Eliška Mourycová
<pre>
33 11 Eliška Mourycová
scp /path/server_config root@{machine_ip}:/<path>/
34 8 Eliška Mourycová
</pre>
35 1 Eliška Mourycová
36 7 Roman Kalivoda
h3. Building the project
37 1 Eliška Mourycová
38
At the moment, the easiest way to build the project is to build it locally in Windows with the following commands:
39
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:
40 11 Eliška Mourycová
<pre>
41
dotnet --list-sdks
42
</pre>
43
44 7 Roman Kalivoda
Version 5.0 is needed to build the project. If you have this version, you can build the project:
45 11 Eliška Mourycová
46
<pre>
47
dotnet publish --runtime=linux-x64 ServerApp.sln
48
</pre>
49
50 1 Eliška Mourycová
The built project files are in folder:
51
.\ServerApp\bin\Debug\net5.0\linux-x64\publish
52
53 12 Eliška Mourycová
54
h3. Note
55
56
The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space.
57
58
h3. Running the server
59
60
* A folder named *data* must exist in the directory where the app is launched
61
* A .p12 file named *cert.p12* must exist in the directory where the app is launched
62
** We used this one: attachment:cert.p12
63
64
Firstly you most grant permission to run the executable:
65
66
<pre>
67
chmod +x <path>/ServerApp
68
</pre>
69
70
Then you can run the server:
71
72
<pre>
73
<path>/ServerApp <args>
74
</pre>
75
76
77
78 1 Eliška Mourycová
---
79 11 Eliška Mourycová
80 1 Eliška Mourycová
h3. Certificate generation and usage (DEPRECATED)
81 11 Eliška Mourycová
82 1 Eliška Mourycová
This section provides instructions for generating and using a certificate with a secific port.
83 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.
84
* Follow these steps if the above stated instructions didn't work as expected.
85 1 Eliška Mourycová
86 12 Eliška Mourycová
h4. Mono installation
87
88
<pre>
89
sudo apt install mono-complete
90
</pre>
91
92
93 11 Eliška Mourycová
h4. Generating the certificate
94
95
http://www.mono-project.com/archived/using-clientcertificates-with-xsp/
96 7 Roman Kalivoda
97 2 Eliška Mourycová
<pre>
98 1 Eliška Mourycová
makecert -r -n "CN=My Own Test CA" -sv root.key root.cer
99
certmgr --add -c Trust root.cer
100 9 Eliška Mourycová
hostname (displays the machine's host name)
101
makecert -iv root.key -ic root.cer -eku 1.3.6.1.5.5.7.3.1 -n "CN={hostname}" -p12 {hostname}.p12 s3kr3t
102 1 Eliška Mourycová
</pre>
103 10 Eliška Mourycová
104 1 Eliška Mourycová
h4. Linking the certificate to a port?
105 9 Eliška Mourycová
106 7 Roman Kalivoda
<pre>
107 2 Eliška Mourycová
httpcfg -add -port {port} -pvk root.key -cert root.crt
108 8 Eliška Mourycová
</pre>
109 11 Eliška Mourycová
110 8 Eliška Mourycová
h4. Adding trusted root certificates to the server (idk if this has any effect)
111 2 Eliška Mourycová
112 8 Eliška Mourycová
Copy your CA to dir /usr/local/share/ca-certificates/
113 7 Roman Kalivoda
Use command: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt
114 8 Eliška Mourycová
Update the CA store: sudo update-ca-certificates
115 11 Eliška Mourycová
116 8 Eliška Mourycová
---