88 lines
2.2 KiB
PHP
88 lines
2.2 KiB
PHP
<?php
|
|
// Test des Apache-Status
|
|
echo "🔍 Apache-Status Test\n";
|
|
echo "===================\n\n";
|
|
|
|
// 1. Prüfe ob Apache läuft
|
|
echo "1. Apache-Prozess prüfen:\n";
|
|
$processes = shell_exec('ps aux | grep apache2 | grep -v grep');
|
|
if ($processes) {
|
|
echo " ✅ Apache-Prozesse gefunden:\n";
|
|
echo " $processes\n";
|
|
} else {
|
|
echo " ❌ Keine Apache-Prozesse gefunden\n";
|
|
}
|
|
|
|
// 2. Prüfe Apache-Port
|
|
echo "\n2. Apache-Port prüfen:\n";
|
|
$ports = shell_exec('netstat -tlnp | grep :80');
|
|
if ($ports) {
|
|
echo " ✅ Apache läuft auf Port 80:\n";
|
|
echo " $ports\n";
|
|
} else {
|
|
echo " ❌ Apache läuft nicht auf Port 80\n";
|
|
}
|
|
|
|
// 3. Prüfe Apache-Logs
|
|
echo "\n3. Apache-Logs prüfen:\n";
|
|
$logFiles = [
|
|
'/var/log/apache2/error.log',
|
|
'/var/log/apache2/access.log',
|
|
'/var/log/apache2/neonail_error.log'
|
|
];
|
|
|
|
foreach ($logFiles as $logFile) {
|
|
if (file_exists($logFile)) {
|
|
echo " 📋 $logFile gefunden\n";
|
|
$lines = file($logFile);
|
|
$lastLines = array_slice($lines, -3);
|
|
foreach ($lastLines as $line) {
|
|
echo " " . trim($line) . "\n";
|
|
}
|
|
} else {
|
|
echo " ❌ $logFile nicht gefunden\n";
|
|
}
|
|
}
|
|
|
|
// 4. Prüfe .htaccess
|
|
echo "\n4. .htaccess prüfen:\n";
|
|
if (file_exists('public/.htaccess')) {
|
|
echo " ✅ public/.htaccess gefunden\n";
|
|
$content = file_get_contents('public/.htaccess');
|
|
echo " 📄 Inhalt:\n";
|
|
echo " " . str_replace("\n", "\n ", $content) . "\n";
|
|
} else {
|
|
echo " ❌ public/.htaccess nicht gefunden\n";
|
|
}
|
|
|
|
// 5. Prüfe Laravel
|
|
echo "\n5. Laravel prüfen:\n";
|
|
if (file_exists('public/index.php')) {
|
|
echo " ✅ public/index.php gefunden\n";
|
|
} else {
|
|
echo " ❌ public/index.php nicht gefunden\n";
|
|
}
|
|
|
|
// 6. Test HTTP-Request
|
|
echo "\n6. HTTP-Request Test:\n";
|
|
$context = stream_context_create([
|
|
'http' => [
|
|
'timeout' => 5,
|
|
'method' => 'GET'
|
|
]
|
|
]);
|
|
|
|
$result = @file_get_contents('http://localhost/', false, $context);
|
|
if ($result !== false) {
|
|
echo " ✅ HTTP-Request erfolgreich\n";
|
|
} else {
|
|
echo " ❌ HTTP-Request fehlgeschlagen\n";
|
|
$error = error_get_last();
|
|
if ($error) {
|
|
echo " Fehler: " . $error['message'] . "\n";
|
|
}
|
|
}
|
|
|
|
echo "\n✅ Apache-Status Test abgeschlossen!\n";
|
|
?>
|