feat: Add deployment guide for IONOS VPS setup

This commit is contained in:
Sascha 2026-06-05 15:08:57 +02:00
parent 8d195db278
commit 3a6ea4ca62
1 changed files with 162 additions and 0 deletions

View File

@ -0,0 +1,162 @@
# GPLX Deploy auf IONOS VPS
Zielumgebung: IONOS VPS oder Cloud Server mit Root-SSH-Zugang, Debian/Ubuntu.
---
## 1. Server-Voraussetzungen
SSH auf den Server, dann:
```bash
apt update && apt install -y apache2 php8.3 php8.3-mysql php8.3-xml \
php8.3-mbstring php8.3-intl php8.3-curl php8.3-gd php8.3-zip \
mariadb-server git
```
---
## 2. Code auf den Server bringen
### Option A: über ein Git-Remote
```bash
# lokal einmalig ein Remote hinzufügen
git remote add ionos ssh://root@<server-ip>/var/www/gplx
git push ionos main
```
### Option B: direkt auf dem Server klonen
```bash
cd /var/www
git clone <git-remote-url> gplx
```
---
## 3. MySQL-Datenbank einrichten
```bash
mysql -u root -p
```
```sql
CREATE DATABASE gplx CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'gplx'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON gplx.* TO 'gplx'@'localhost';
FLUSH PRIVILEGES;
EXIT;
```
---
## 4. LocalSettings.php anpassen
Drei Stellen müssen auf Produktionswerte geändert werden:
```php
// Server-URL
$wgServer = "https://yourdomain.de";
// Datenbank
$wgDBserver = "localhost";
$wgDBname = "gplx";
$wgDBuser = "gplx";
$wgDBpassword = "STRONG_PASSWORD";
// Semantic MediaWiki (im ExtensionFunctions-Hook)
enableSemantics( 'yourdomain.de' ); // Domain ohne Protokoll und Port
```
Neuen Secret Key generieren (der aktuelle ist im Git-Verlauf):
```bash
openssl rand -hex 32
```
Den generierten Wert als `$wgSecretKey` eintragen.
---
## 5. Datenbank-Tabellen anlegen
Da die Datenbank neu und leer ist, reicht `update.php`:
```bash
cd /var/www/gplx/mediawiki
php maintenance/run.php update --quick
```
---
## 6. SMW-Tabellen einrichten
```bash
php extensions/SemanticMediaWiki/maintenance/setupStore.php --nochecks
```
---
## 7. Apache-Vhost konfigurieren
Datei `/etc/apache2/sites-available/gplx.conf` anlegen:
```apache
<VirtualHost *:80>
ServerName yourdomain.de
DocumentRoot /var/www/gplx/mediawiki
<Directory /var/www/gplx/mediawiki>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
```
```bash
a2enmod rewrite
a2ensite gplx
a2dissite 000-default
systemctl reload apache2
```
Für HTTPS (empfohlen) Certbot nachinstallieren:
```bash
apt install -y certbot python3-certbot-apache
certbot --apache -d yourdomain.de
```
---
## 8. Dateisystem-Berechtigungen
```bash
chown -R www-data:www-data /var/www/gplx/mediawiki/images
chmod -R 755 /var/www/gplx/mediawiki/images
```
---
## 9. Smoke-Test
1. `https://yourdomain.de` im Browser öffnen Startseite muss laden.
2. Als Admin einloggen und eine Testseite erstellen.
3. SMW-Abfrage prüfen: `Special:Ask` aufrufen.
4. Accessibility-Check lokal gegen die Live-URL laufen lassen:
```bash
npm run a11y:all
```
(Pa11y-Ziel-URL in `tests/accessibility/pa11y.config.json` vorher anpassen.)
---
## Wichtige Gotchas
| Problem | Ursache | Lösung |
|---|---|---|
| SMW speichert keine Eigenschaften | `enableSemantics()` enthält noch `127.0.0.1:8080` | Domain in LocalSettings.php korrigieren, `rebuildData.php` ausführen |
| Seiten zeigen "Page Not Available" | ApprovedRevs aktiv, keine genehmigte Version | Als Admin einloggen und Revision genehmigen |
| 500-Fehler nach Deploy | `$wgShowExceptionDetails = true` für Debug, danach wieder entfernen | Fehlermeldung lesen, dann deaktivieren |
| Images-Ordner nicht beschreibbar | Falscher Owner nach `git clone` | `chown -R www-data:www-data images/` |