-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
157 lines (102 loc) · 3.92 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
instructions
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04#step-5-setting-up-server-blocks-(recommended)
http://nginx.org/ru/docs/http/configuring_https_servers.html
https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
// root nVZKx921
// /etc/systemd/system/site.service конфигурация сервиса
[Unit]
Description=Example .NET Web API App running on Ubuntu
[Service]
WorkingDirectory=/var/site
ExecStart=/usr/bin/dotnet /var/site/SoftMasters.test.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
Environment=ConnectionStrings__dmise.dev="server=92.53.120.213;user=root;database=SoftMasters;password=Develop3r0;port=3306"
[Install]
WantedBy=root.target
------------------------------------------------------------
// sudo systemctl enable site.service sudo systemctl disable site.service
//sudo service nginx start
//sudo systemctl restart nginx
// sudo systemctl start site.service
// sudo systemctl status site.service
// sudo systemctl status nginx.service
// projectfile
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols> <!-- не выпускает в резил pdb файлы -->
</PropertyGroup>
---NGINX COMMAND ----
// /etc/nginx/sites-available/dmise.dev
nginx -t && nginx -s reload
systemctl reload nginx; systemctl restart nginx
//sudo apt-get install aptitude
// sudo nano /etc/nginx/sites-available/dmise.dev
server {
listen 80;
listen [::]:80;
root /var/www/dmise.dev/html;
index index.html index.htm index.nginx-debian.html;
server_name dmise.dev www.dmise.dev;
location / {
try_files $uri $uri/ =404;
}
}
// создаем ссылку
sudo ln -s /etc/nginx/sites-available/dmise.dev /etc/nginx/sites-enabled/
// http://www.dmise.dev/ http://dmise.dev/
//Run the following command to generate certificates with the NGINX plug‑in:
// sudo certbot --nginx -d dmise.dev -d www.dmise.dev
// /etc/letsencrypt/renewal/dmise.dev.conf
$$$$$$$$$$$$$$$$ commands
nginx -t && nginx -s reload
$$$$$$$$$$$$$$
// пути до ключей
// /etc/letsencrypt/live/dmise.dev/fullchain.pem
/etc/letsencrypt/live/dmise.dev/privkey.pem
/etc/letsencrypt/live/dmise.dev/cert.pem
/etc/letsencrypt/live/dmise.dev/chain.pem
http{
ssl_session_timeout 10m;
server{
}
}
//etc/nginx/site-available/dmise.dev // не рабочий вариант
server {
listen 443 ssl;
listen 80;
listen [::]:80;
root /var/www/dmise.dev/html;
index index.html index.htm index.nginx-debian.html;
server_name dmise.dev www.dmise.dev;
ssl_certificate /etc/letsencrypt/live/dmise.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dmise.dev/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
try_files $uri $uri/ =404;
}
}
// //dmise.dev.conf in the foler /etc/nginx/site-available/dmise
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/dmise.dev/html;
index index.html index.htm index.nginx-debian.html;
server_name dmise.dev www.dmise.dev;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/dmise.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dmise.dev/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}