chore: complete update
This commit is contained in:
115
ansible/nginx-cdn-germany/SETUP.md
Normal file
115
ansible/nginx-cdn-germany/SETUP.md
Normal file
@@ -0,0 +1,115 @@
|
||||
# SETUP.md - Einrichtungsanleitung
|
||||
|
||||
## 1. Vorbereitung
|
||||
|
||||
### Server vorbereiten
|
||||
```bash
|
||||
# Für jeden CDN-Server (als root):
|
||||
apt update && apt upgrade -y
|
||||
apt install -y python3 python3-pip
|
||||
```
|
||||
|
||||
### SSH-Keys einrichten
|
||||
```bash
|
||||
# Auf deinem lokalen Rechner:
|
||||
ssh-keygen -t rsa -b 4096 -C "cdn-deployment"
|
||||
ssh-copy-id root@cdn-fra1.example.de
|
||||
ssh-copy-id root@cdn-ham1.example.de
|
||||
ssh-copy-id root@cdn-muc1.example.de
|
||||
```
|
||||
|
||||
## 2. Konfiguration anpassen
|
||||
|
||||
### Domains und IPs ändern
|
||||
```bash
|
||||
# 1. Server-IPs eintragen
|
||||
vim inventories/production/hosts.yml
|
||||
|
||||
# 2. Domain-Namen anpassen
|
||||
vim inventories/production/group_vars/all/main.yml
|
||||
```
|
||||
|
||||
**Wichtig:** Ändere diese Werte:
|
||||
- `cdn_domain: "cdn.example.de"` → deine CDN-Domain
|
||||
- `ssl_email: "admin@example.de"` → deine E-Mail
|
||||
- `origin_domain: "www.example.de"` → deine Website
|
||||
- Alle IP-Adressen in `hosts.yml`
|
||||
|
||||
## 3. DNS konfigurieren
|
||||
|
||||
Bevor du deployest, stelle sicher dass deine CDN-Domain zu den Servern zeigt:
|
||||
|
||||
```bash
|
||||
# A-Records für deine CDN-Domain:
|
||||
cdn.example.de. IN A 10.0.1.10 # Frankfurt
|
||||
cdn.example.de. IN A 10.0.2.10 # Hamburg
|
||||
cdn.example.de. IN A 10.0.3.10 # München
|
||||
```
|
||||
|
||||
## 4. Deployment
|
||||
|
||||
```bash
|
||||
# Testen
|
||||
make check
|
||||
|
||||
# Deployen
|
||||
make deploy
|
||||
|
||||
# Health-Check
|
||||
make health
|
||||
```
|
||||
|
||||
## 5. Testen
|
||||
|
||||
```bash
|
||||
# CDN testen
|
||||
curl -I https://cdn.example.de/health
|
||||
|
||||
# Cache-Header prüfen
|
||||
curl -I https://cdn.example.de/some-static-file.css
|
||||
|
||||
# Performance testen
|
||||
time curl -o /dev/null -s https://cdn.example.de/
|
||||
```
|
||||
|
||||
## 6. Wartung
|
||||
|
||||
```bash
|
||||
# Cache leeren
|
||||
make purge-cache
|
||||
|
||||
# Status prüfen
|
||||
make status
|
||||
|
||||
# SSL erneuern
|
||||
make renew-ssl
|
||||
|
||||
# Interaktive Verwaltung
|
||||
make manage
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Ansible-Verbindung testen
|
||||
```bash
|
||||
ansible all -m ping
|
||||
```
|
||||
|
||||
### Nginx-Konfiguration prüfen
|
||||
```bash
|
||||
ansible cdn_nodes -m shell -a "nginx -t"
|
||||
```
|
||||
|
||||
### Logs anschauen
|
||||
```bash
|
||||
ansible cdn_nodes -m shell -a "tail -f /var/log/nginx/error.log"
|
||||
```
|
||||
|
||||
### SSL-Probleme
|
||||
```bash
|
||||
# SSL-Status prüfen
|
||||
ansible cdn_nodes -m shell -a "certbot certificates"
|
||||
|
||||
# Manuell erneuern
|
||||
ansible cdn_nodes -m shell -a "certbot renew --force-renewal"
|
||||
```
|
||||
Reference in New Issue
Block a user