Files
stechuhr3/deployment-configs/INSTALL_CONFIGS.sh

55 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# =============================================================================
# TimeClock v3 - Apache-Konfiguration installieren
# =============================================================================
set -e
echo "🚀 Installiere TimeClock Apache-Konfiguration..."
# 1. SSLStapling global aktivieren
echo "📝 Konfiguriere SSLStapling..."
if ! grep -q "SSLStaplingCache" /etc/apache2/mods-available/ssl.conf; then
sudo sed -i '/<\/IfModule>/i \ # OCSP Stapling Cache\n SSLStaplingCache shmcb:\/var\/run\/ocsp(128000)' /etc/apache2/mods-available/ssl.conf
echo "✅ SSLStapling konfiguriert"
else
echo "✅ SSLStapling bereits konfiguriert"
fi
# 2. Kopiere HTTP-Config
echo "📝 Kopiere HTTP-VirtualHost..."
sudo cp stechuhr3.tsschulz.de.conf /etc/apache2/sites-available/
# 3. Kopiere HTTPS-Config
echo "📝 Kopiere HTTPS-VirtualHost..."
sudo cp stechuhr3.tsschulz.de-le-ssl.conf /etc/apache2/sites-available/
# 4. Aktiviere Sites (falls noch nicht aktiv)
echo "📝 Aktiviere VirtualHosts..."
sudo a2ensite stechuhr3.tsschulz.de 2>/dev/null || echo "✅ HTTP bereits aktiviert"
sudo a2ensite stechuhr3.tsschulz.de-le-ssl 2>/dev/null || echo "✅ HTTPS bereits aktiviert"
# 5. Teste Konfiguration
echo "🔍 Teste Apache-Konfiguration..."
sudo apache2ctl configtest
# 6. Apache neustarten
echo "🔄 Starte Apache neu..."
sudo systemctl restart apache2
# 7. Status prüfen
echo ""
echo "📊 Apache Status:"
sudo systemctl status apache2 --no-pager | head -n 10
echo ""
echo "✅ Installation abgeschlossen!"
echo ""
echo "🌐 Teste deine App:"
echo " https://stechuhr3.tsschulz.de"
echo " https://stechuhr3.tsschulz.de/api/health"
exit 0