Anwendungen
Webserver
- Apache 2.4 - HTTP/2, Brotli
- PHP 8.4 - FPM, Extensions
Datenbanken
- MariaDB 11.8 - Relationale DB
- phpMyAdmin 5.2 - Web-Verwaltung
Laufzeitumgebungen
- Python 3.13 - Runtime
- tmux - Terminal Multiplexer
Dienste
- Nextcloud - Datei-Management
- Semantic Explorer - Wissensnavigation
- Contracts - Contract-Management UI
Verwandte Themen
- KI-System - Ollama, Qdrant, NVIDIA
- Qualitätssicherung - PHP-Quality, Frontend-Quality
- SSL/TLS - Let's Encrypt
Apache Webserver
Webserver der alle HTTP/HTTPS-Anfragen entgegennimmt und an PHP weiterleitet. Hostet die drei Domains mit virtuellen Hosts und sorgt für SSL-Terminierung.
| Version | 2.4.x |
|---|---|
| Status | aktiv |
| Ports | 80, 443 |
Module
ssl http2 brotli rewrite headers proxy proxy_http proxy_fcgi proxy_wstunnel setenvif
Brotli-Kompression
Datei: /etc/apache2/conf-available/brotli.conf
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml
BrotliCompressionQuality 4
</IfModule>
Virtual Hosts
campus.systemische-tools.de→ /var/www/prod.../publicdev.campus.systemische-tools.de→ /var/www/dev.../publicfiles.campus.systemische-tools.de→ /var/www/nextcloud
Befehle
systemctl status apache2
systemctl restart apache2
apache2 -vPHP 8.4
Serverseitige Programmiersprache für die Webanwendung. Läuft als FPM (FastCGI Process Manager) für bessere Performance und Ressourcennutzung.
| Version | 8.4.16 |
|---|---|
| SAPI | FPM (FastCGI) |
| Konfig | /etc/php/8.4/ |
Installierte Erweiterungen
- mysql, curl, gd, mbstring, xml, zip
- intl, bcmath, opcache, apcu, redis, imagick
Installation
apt-get install -y php8.4 php8.4-cli php8.4-fpm php8.4-mysql \
php8.4-curl php8.4-gd php8.4-mbstring php8.4-xml php8.4-zip \
php8.4-intl php8.4-bcmath php8.4-opcache php8.4-apcu php8.4-redis \
php8.4-imagick libapache2-mod-php8.4
Befehle
php -v
systemctl status php8.4-fpm
systemctl restart php8.4-fpmMariaDB
Relationale Datenbank für strukturierte Daten. MySQL-kompatibel, schnell und zuverlässig. Speichert alle Anwendungsdaten des KI-Systems.
| Version | 11.8.3 |
|---|---|
| Port | 3306 |
| Konfig | /etc/mysql/ |
Datenbanken
| Datenbank | Tabellen | Zweck |
|---|---|---|
| ki_dev | 23 | Infrastruktur: Tasks, Contracts, Docs, Pipeline, Logs, Code-Analyse |
| ki_content | 35 | Content: Chat, Wissen, Entitäten, Taxonomie, Ontologie, Dokumente |
Zugriff via MCP
Wichtig: Datenbankzugriff erfolgt ausschließlich über MCP-DB. Keine direkten SQL-Befehle!
# MCP-Tools verwenden:
db_select("SELECT * FROM tasks LIMIT 10", database="ki_dev")
db_tables(database="ki_dev")
db_describe(table="tasks", database="ki_dev")
Datenbank erstellen (nur Admin)
mariadb -e "CREATE DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
mariadb -e "CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';"
mariadb -e "GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'localhost';"
mariadb -e "FLUSH PRIVILEGES;"
Befehle
mariadb -V
systemctl status mariadb
mariadb-dump --all-databases > backup.sql
Verwandte Themen
- MCP-DB - Datenbankzugriff via MCP
- KI-Datenbank - Schema-Details
- Backup - Datenbank-Sicherung
phpMyAdmin
Web-basierte Datenbankverwaltung für MariaDB/MySQL. Ermöglicht Datenbankoperationen, Tabellenmanagement und SQL-Abfragen im Browser.
| Version | 5.2.2 |
|---|---|
| URL | /myadm (nur dev) |
| Installation | /usr/share/phpmyadmin |
| Konfig | /etc/phpmyadmin/ |
Zugang
| URL | https://dev.campus.systemische-tools.de/myadm |
|---|---|
| Benutzer | root |
| Passwort | siehe Credentials |
Funktionen
- Datenbanken erstellen, bearbeiten, löschen
- Tabellen und Strukturen verwalten
- SQL-Abfragen ausführen
- Daten importieren/exportieren
- Benutzer und Berechtigungen verwalten
Sicherheit
- Zugriff nur unter /myadm (nicht /phpmyadmin)
- Standard-Pfad /phpmyadmin deaktiviert
- Nur auf dev-Domain aktiv
Konfiguration
/etc/apache2/conf-available/phpmyadmin-myadm.conf
/etc/phpmyadmin/config.inc.php
/etc/phpmyadmin/config-db.phpNextcloud
Self-hosted Cloud-Speicher für Dateien und Dokumente. Ersetzt Dropbox/Google Drive mit voller Datenkontrolle und DSGVO-Konformität.
| URL | https://files.campus.systemische-tools.de |
|---|---|
| Pfad | /var/www/nextcloud |
| Datenbank | MariaDB: nextcloud |
Installation
cd /var/www
curl -LO https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -xjf latest.tar.bz2
chown -R www-data:www-data nextcloud
Datenbank
mariadb -e "CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
mariadb -e "CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'PASSWORD';"
mariadb -e "GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';"Python
Skriptsprache für KI/ML-Aufgaben und Automatisierung. Basis für viele KI-Tools, Bibliotheken und Embedding-Generierung.
| Version | 3.13.5 |
|---|---|
| Herkunft | Debian 13 Standard |
Zusätzliche Pakete
apt-get install -y python3-pip python3-venv python3-dev build-essential
Virtuelle Umgebung
python3 -m venv /opt/myproject/venv
source /opt/myproject/venv/bin/activate
pip install --upgrade pip
Version prüfen
python3 --version
pip3 --versiontmux
Terminal-Multiplexer für persistente Shell-Sessions. Prozesse laufen weiter auch wenn die SSH-Verbindung abbricht. Ermöglicht mehrere Terminals in einer Verbindung.
| Version | 3.5a |
|---|---|
| Konfig | /root/.tmux.conf |
Tastenkürzel
| Prefix | Ctrl+b oder Ctrl+a |
|---|---|
| Prefix + | | Vertikal teilen |
| Prefix + - | Horizontal teilen |
| Alt + Pfeile | Panes wechseln |
| Prefix + c | Neues Fenster |
| Prefix + d | Detach |
Befehle
tmux new -s session
tmux attach -t session
tmux ls
tmux kill-session -t session
Kitty-Verbindung
ssh -p 2022 root@SERVER -t "tmux new -A -s main"Semantic Explorer
Exploration und Suche in der Dokumentations-Pipeline. Zeigt hierarchische Dokumente, deren Seiten und die extrahierten Text-Chunks mit Taxonomie-Klassifizierung, Keywords und Entities.
| URL | /semantic-explorer |
|---|---|
| Datenbank | ki_content (documents, chunks) |
| Controller | /src/Controller/SemanticExplorerController.php |
| Views | /src/View/semantic-explorer/ |
| Pipeline | /var/www/scripts/pipeline/ |
Datenmodell
| Tabelle | Beschreibung | Felder |
|---|---|---|
documents |
Quelldokumente | id, filename, title, source, page_count, status, created_at |
chunks |
Extrahierte Text-Chunks | id, document_id, chunk_index, content, token_count, embedding_model, qdrant_id |
Web-UI Komponenten
| Seite | URL | Beschreibung |
|---|---|---|
| Dashboard | /semantic-explorer | Statistiken, Top-Kategorien, neueste Chunks |
| Entitäten | /semantic-explorer/entitaeten | Alle extrahierten Entitäten |
| Relationen | /semantic-explorer/relationen | Beziehungen zwischen Entitäten |
| Taxonomie | /semantic-explorer/taxonomie | Taxonomie-Hierarchie |
| Ontologie | /semantic-explorer/ontologie | Ontologie-Klassen |
| Chunks | /semantic-explorer/chunks | Alle Chunks mit Filter |
| Graph | /semantic-explorer/graph | Wissens-Graph Visualisierung |
Detail-Ansichten
/semantic-explorer/entitaeten/{id}- Entity-Details mit Vorkommen/semantic-explorer/chunks/{id}- Chunk-Details: Entities, Keywords, Semantik
API-Endpoints
| Method | Endpoint | Beschreibung |
|---|---|---|
| GET | /api/v1/explorer/stats | Statistiken (Documents, Chunks, Entities) |
| GET | /api/v1/explorer/entities | Alle Entitäten |
| GET | /api/v1/explorer/relations | Alle Relationen |
| GET | /api/v1/explorer/taxonomy | Taxonomie-Hierarchie |
| GET | /api/v1/explorer/ontology | Ontologie-Klassen |
| GET | /api/v1/explorer/documents | Alle Dokumente |
Chunk-Analyse
Die Pipeline extrahiert aus jedem Chunk:
- entities: Erkannte Entitäten mit Typ (PERSON, ORGANIZATION, CONCEPT, etc.)
- keywords: Relevante Schlüsselwörter
- token_count: Anzahl Tokens für LLM-Budgetierung
- embedding_model: Verwendetes Embedding-Modell
- qdrant_id: ID im Vektor-Index
HybridSearch
Die Suche kombiniert semantische Vektorsuche (Qdrant) mit Keyword-Matching (MariaDB).
API-Aufruf
# Einfache Suche
curl -X POST https://dev.campus.systemische-tools.de/api/v1/explorer/search \
-H "Content-Type: application/json" \
-d '{"query": "Systemische Therapie", "limit": 10}'
Response-Format
{
"success": true,
"data": {
"query": "Systemische Therapie",
"results": [
{
"id": 42,
"content": "...",
"document_title": "Handbuch",
"score": 0.87
}
],
"count": 5
}
}
Statistiken abrufen
curl https://dev.campus.systemische-tools.de/api/v1/explorer/stats
Response
{
"success": true,
"data": {
"documents": 12,
"chunks": {
"total": 234,
"tokens": 125000
},
"entities": 450,
"relations": 320
}
}
Pipeline-Integration
Die Chunks werden von der Analyse-Pipeline generiert:
/var/www/scripts/pipeline/pipeline.py- Haupt-Pipeline/var/www/scripts/pipeline/step_chunk.py- Chunk-Erstellung/var/www/scripts/pipeline/step_embed.py- Embedding-Generierung/var/www/scripts/pipeline/step_semantic.py- Semantik-Analyse
Siehe: RAG-Prozess
Contracts Web-UI
Web-Oberfläche zur Verwaltung von Contracts - YAML-basierte Qualitätsverträge für Code und Dokumentation.
| URL | /contracts |
|---|---|
| Controller | ContractController |
| Views | /src/View/contracts/ |
| Datenbank | ki_dev.contracts |
| MCP-Server | mcp-contracts |
Funktionen
- Liste: Alle Contracts mit Status-Filter (draft, active, deprecated)
- Erstellen: Neue Contracts mit YAML-Editor
- Bearbeiten: Contract-YAML ändern (erstellt neue Version)
- Validieren: Contract gegen Scope ausführen
- Historie: Änderungshistorie mit Versionierung
Routes
| Route | Methode | Beschreibung |
|---|---|---|
| /contracts | GET | Contract-Liste |
| /contracts/new | GET | Neuer Contract (Formular) |
| /contracts | POST | Contract erstellen |
| /contracts/{id} | GET | Contract-Details |
| /contracts/{id}/edit | GET | Contract bearbeiten |
Views
| Datei | Funktion |
|---|---|
| index.php | Contract-Übersicht mit Filter und Statistiken |
| show.php | Contract-Details mit YAML-Anzeige und Validierung |
| new.php | Formular für neuen Contract |
| edit.php | Formular zum Bearbeiten |
Contract-Struktur (YAML)
name: example-contract
version: "1.0"
scope:
paths:
- /src/View/example/
patterns:
- "*.php"
rules:
- type: structure
check: required_elements
elements: [h1, table]
- type: content
check: no_hardcoded_paths
thresholds:
critical: 0
major: 2
minor: 5
Versionierung
Jede Änderung an einem Contract erstellt automatisch eine neue Version. Die Historie wird in ki_dev.contract_history gespeichert.
Integration
- MCP-Contracts: API-Zugriff via MCP-Tools (contracts_list, contracts_validate, etc.)
- Pre-Sync Hook: Validierung vor Deployment zu prod
- Claude Code: Automatische Prüfung bei Code-Änderungen
Siehe auch
- MCP-Contracts - MCP-Server für Contract-API
- Contracts (Konzept) - Contract-System Konzept und alle aktiven Contracts
- PHP-Quality - PHPStan, PHP-CS-Fixer Integration
Content Pipeline
System zur Verarbeitung von Dokumenten aus Nextcloud mit konfigurierbaren Pipeline-Stufen.
Übersicht
Die Content Pipeline verarbeitet Dokumente in mehreren Schritten:
- Import - Dokumente aus Nextcloud scannen und in Queue aufnehmen
- Extract - Text aus PDF, DOCX, PPTX, MD, TXT extrahieren
- Chunk - Semantisches Chunking mit Struktur-Erhaltung
- Embed - Vektorisierung via Ollama → Qdrant
- Analyze - Entitäten, Relationen, Taxonomie extrahieren
Sub-Seiten
- /content-pipeline/import - Import-Konfiguration
Technische Basis
| Komponente | Technologie |
|---|---|
| Quelle | Nextcloud /var/www/nextcloud/data/root/files/Documents |
| Datenbank | MariaDB ki_content |
| Vektoren | Qdrant localhost:6333 |
| Embedding | Ollama mxbai-embed-large (1024 dims) |
| Analyse | Anthropic Claude / Ollama |