更新 Service:Traefik
@@ -8,4 +8,40 @@ wget https://github.com/traefik/traefik/releases/download/v3.7.4/traefik_v3.7.4_
|
||||
|
||||
```bash
|
||||
tar zxvf traefik_v3.7.4_linux_amd64.tar.gz -C /usr/local/bin/ traefik
|
||||
```
|
||||
|
||||
# 設計 Traefik 服務
|
||||
|
||||
```bash
|
||||
nano /etc/systemd/system/traefik.service
|
||||
```
|
||||
|
||||
服務檔內容
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Traefik Proxy
|
||||
|
||||
[Service]
|
||||
Environment=HOME=/root
|
||||
Type=simple
|
||||
WorkingDirectory=/root
|
||||
ExecStart=/usr/local/bin/traefik --configFile=traefik.toml
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
啟動服務
|
||||
|
||||
```bash
|
||||
systemctl daemon-reload && systemctl enable traefik.service && systemctl start traefik.service && systemctl status traefik.service
|
||||
```
|
||||
|
||||
停止服務
|
||||
|
||||
```bash
|
||||
systemctl stop traefik.service && systemctl disable traefik.service && rm /etc/systemd/system/traefik.service
|
||||
```
|
||||
Reference in New Issue
Block a user