68 lines
1.7 KiB
Bash
Executable File
68 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🌐 Apache DocumentRoot korrigieren"
|
|
echo "================================="
|
|
|
|
# 1. Standard-Site deaktivieren
|
|
echo "🔧 Deaktiviere Standard-Site..."
|
|
a2dissite 000-default.conf 2>/dev/null || echo "⚠️ Standard-Site bereits deaktiviert"
|
|
|
|
# 2. NeoNail-Site neu erstellen
|
|
echo "📝 Erstelle NeoNail-Site neu..."
|
|
cat > /etc/apache2/sites-available/neonail.conf << 'EOF'
|
|
<VirtualHost *:80>
|
|
ServerName 192.168.30.81
|
|
DocumentRoot /var/www/html/public
|
|
|
|
<Directory /var/www/html/public>
|
|
AllowOverride All
|
|
Require all granted
|
|
Options Indexes FollowSymLinks
|
|
</Directory>
|
|
|
|
# Sicherheit für sensible Dateien
|
|
<Directory /var/www/html>
|
|
<Files ".env">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
|
|
<Files "database.sqlite">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
</Directory>
|
|
|
|
ErrorLog ${APACHE_LOG_DIR}/neonail_error.log
|
|
CustomLog ${APACHE_LOG_DIR}/neonail_access.log combined
|
|
</VirtualHost>
|
|
EOF
|
|
|
|
# 3. NeoNail-Site aktivieren
|
|
echo "✅ Aktiviere NeoNail-Site..."
|
|
a2ensite neonail.conf
|
|
|
|
# 4. Apache-Konfiguration testen
|
|
echo "🔍 Teste Apache-Konfiguration..."
|
|
apache2ctl configtest
|
|
|
|
# 5. Apache neu laden
|
|
echo "🔄 Lade Apache neu..."
|
|
systemctl reload apache2
|
|
|
|
# 6. Status prüfen
|
|
echo "📊 Apache-Status..."
|
|
systemctl status apache2 --no-pager -l
|
|
|
|
# 7. Test
|
|
echo "🧪 Teste Anwendung..."
|
|
curl -I http://192.168.30.81
|
|
|
|
echo ""
|
|
echo "✅ Apache DocumentRoot korrigiert!"
|
|
echo "📋 Testen Sie: http://192.168.30.81"
|
|
echo ""
|
|
echo "📋 Falls es nicht funktioniert:"
|
|
echo "1. Apache-Logs: tail -f /var/log/apache2/neonail_error.log"
|
|
echo "2. DocumentRoot prüfen: apache2ctl -S"
|