#!/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