Installation Setup - teris/Server-Management-Framework GitHub Wiki
Diese Anleitung führt Sie durch die Installation und Konfiguration des Server Management Frameworks.
- PHP Version: 7.4 oder höher
-
PHP Extensions:
-
curl
- Für API-Kommunikation -
json
- Für JSON-Verarbeitung -
soap
- Für ISPConfig API (optional) -
pdo_mysql
- Für Datenbankverbindungen -
openssl
- Für sichere Verbindungen
-
- MySQL: 5.7 oder höher
- MariaDB: 10.2 oder höher
- Webserver: Apache 2.4+ oder Nginx
- Betriebssystem: Linux, Windows, macOS
git clone https://github.com/your-repo/server-management-framework.git
cd server-management-framework
sudo apt update
sudo apt install php-curl php-json php-soap php-mysql php-openssl
sudo yum install php-curl php-json php-soap php-mysql php-openssl
Entfernen Sie die Kommentare in der php.ini
:
extension=curl
extension=json
extension=soap
extension=pdo_mysql
extension=openssl
brew install [email protected]
# SOAP ist standardmäßig enthalten
CREATE DATABASE framework_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'framework_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON framework_db.* TO 'framework_user'@'localhost';
FLUSH PRIVILEGES;
USE framework_db;
CREATE TABLE `activity_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action` varchar(255) NOT NULL,
`details` text,
`status` enum('success','error','warning') NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_created_at` (`created_at`),
KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `api_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`api_name` varchar(50) NOT NULL,
`endpoint` varchar(255) NOT NULL,
`method` varchar(10) NOT NULL,
`success` tinyint(1) NOT NULL,
`response_time` float DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_api_name` (`api_name`),
KEY `idx_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Erstellen Sie die Datei config/config.inc.php
:
<?php
class Config {
// ===== DATENBANK KONFIGURATION =====
const DB_HOST = 'localhost';
const DB_NAME = 'framework_db';
const DB_USER = 'framework_user';
const DB_PASS = 'your_password';
const DB_CHARSET = 'utf8mb4';
// ===== PROXMOX KONFIGURATION =====
const PROXMOX_USEING = true; // true/false
const PROXMOX_HOST = 'https://pve.example.com:8006';
const PROXMOX_USER = 'root@pam';
const PROXMOX_PASSWORD = 'your_proxmox_password';
const PROXMOX_REALM = 'pam'; // Standard: pam
// ===== ISPCONFIG KONFIGURATION =====
const ISPCONFIG_USEING = true; // true/false
const ISPCONFIG_HOST = 'https://ispconfig.example.com:8080';
const ISPCONFIG_USER = 'admin';
const ISPCONFIG_PASSWORD = 'your_ispconfig_password';
const ISPCONFIG_CLIENT_ID = 1; // Standard: 1
// ===== OVH KONFIGURATION =====
const OVH_USEING = true; // true/false
const OVH_APPLICATION_KEY = 'your_ovh_app_key';
const OVH_APPLICATION_SECRET = 'your_ovh_app_secret';
const OVH_CONSUMER_KEY = 'your_ovh_consumer_key';
const OVH_ENDPOINT = 'https://eu.api.ovh.com/1.0'; // eu, ca, us
// ===== OGP KONFIGURATION =====
const OGP_USEING = true; // true/false
const OGP_HOST = 'https://ogp.example.com';
const OGP_USER = 'admin';
const OGP_PASSWORD = 'your_ogp_password';
const OGP_TOKEN = 'your_ogp_token';
// ===== ALLGEMEINE KONFIGURATION =====
const DEBUG_MODE = false; // true/false
const LOG_LEVEL = 'info'; // debug, info, warning, error
const TIMEZONE = 'Europe/Berlin';
}
?>
- Melden Sie sich bei Ihrem Proxmox-Server an
- Gehen Sie zu
Datacenter
→Users
- Erstellen Sie einen API-Benutzer oder verwenden Sie
root@pam
- Notieren Sie sich Host, Benutzer und Passwort
- Melden Sie sich bei ISPConfig an
- Gehen Sie zu
System
→Remote Users
- Erstellen Sie einen Remote-API-Benutzer
- Notieren Sie sich Host, Benutzer und Passwort
- Gehen Sie zu OVH API Keys
- Erstellen Sie eine neue API-Anwendung
- Notieren Sie sich Application Key, Secret und Consumer Key
- Melden Sie sich bei OGP an
- Gehen Sie zu
Settings
→API
- Generieren Sie einen API-Token
- Notieren Sie sich Host, Benutzer und Token
Erstellen Sie test_installation.php
:
<?php
require_once 'framework.php';
echo "=== Framework Installation Test ===\n\n";
// Datenbank-Test
try {
$db = Database::getInstance();
echo "✅ Datenbankverbindung erfolgreich\n";
// Test-Log erstellen
$db->logAction('Installation Test', 'Framework wurde erfolgreich installiert', 'success');
echo "✅ Logging-System funktioniert\n";
} catch (Exception $e) {
echo "❌ Datenbankfehler: " . $e->getMessage() . "\n";
}
// ServiceManager-Test
try {
$serviceManager = new ServiceManager();
echo "✅ ServiceManager initialisiert\n";
// API-Status prüfen
$apis = ['proxmox', 'ispconfig', 'ovh', 'ogp'];
foreach ($apis as $api) {
$status = $serviceManager->checkAPIEnabled($api);
if ($status === true) {
echo "✅ {$api} API ist aktiviert\n";
} else {
echo "⚠️ {$api} API ist deaktiviert oder fehlerhaft\n";
}
}
} catch (Exception $e) {
echo "❌ ServiceManager-Fehler: " . $e->getMessage() . "\n";
}
echo "\n=== Test abgeschlossen ===\n";
?>
php test_installation.php
# Konfigurationsdatei schützen
chmod 600 config/config.inc.php
# Logs-Verzeichnis
mkdir logs
chmod 755 logs
chown www-data:www-data logs
# Konfigurationsdatei schützen
<Files "config.inc.php">
Order allow,deny
Deny from all
</Files>
# Framework-Dateien schützen
<Files "framework.php">
Order allow,deny
Allow from all
</Files>
# Konfigurationsdatei schützen
location ~ ^/config/.*\.php$ {
deny all;
}
# Framework-Dateien erlauben
location ~ ^/framework\.php$ {
allow all;
}
Nach erfolgreicher Installation können Sie:
- API Integration konfigurieren
- Beispiele & Tutorials durchgehen
- Eigene Module erstellen
- Framework Komponenten verstehen
# Ubuntu/Debian
sudo apt install php-soap
# CentOS/RHEL
sudo yum install php-soap
# Windows: php.ini bearbeiten
extension=soap
- Überprüfen Sie Host, Benutzer und Passwort
- Stellen Sie sicher, dass der Benutzer die richtigen Rechte hat
- Prüfen Sie, ob MySQL/MariaDB läuft
- Überprüfen Sie die API-Zugangsdaten
- Stellen Sie sicher, dass die APIs aktiviert sind (
USEING = true
) - Prüfen Sie Firewall-Einstellungen
- Testen Sie die API-Endpunkte manuell
Bei Problemen:
- Überprüfen Sie die Issues
- Erstellen Sie ein neues Issue mit detaillierter Fehlerbeschreibung
- Fügen Sie Logs und Konfigurationsdetails hinzu