-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.txt
51 lines (42 loc) · 958 Bytes
/
deployment.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
1. git clone repository: `git clone https://github.com/agajdosi/nejvyzkum`
2. install requirements: `pip3 install -r requirements.txt`
3. create a service:
```
sudo nano /etc/systemd/system/nejvyzkum.service
```
insert:
```
[Unit]
Description=Unusual subjects web server
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=inovotna
WorkingDirectory=/home/myname/nejvyzkum
ExecStart=python3 /home/myname/nejvyzkum/main.py
[Install]
WantedBy=multi-user.target
```
4. enable the service
```
sudo systemctl enable nejvyzkum
sudo systemctl daemon-reload
```
5. open port 80:
```
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload
```
6. forward port 80 to 8080:
```
sudo firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=8080
sudo firewall-cmd --reload
```
7. add certs
install certbot and then>
```
sudo certbot certonly --standalone --http-01-port 8080
```