diff --git a/README.md b/README.md index 151b592..f9aeccd 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,8 @@ Die E-Mail im Footer (`footer.tsx`) wird als Prop von `app/page.tsx` übergeben: - Baut die Seite (`npm run build`) - Öffnet eine SSH-Master-Verbindung (Passwort nur einmal eingeben) - rsync nach `jamulix.de:/var/www/jamulix.de/html/landingpage/` -- Setzt Symlink: `/var/www/jamulix.de/html/index.html` → `landingpage/index.html` +- Lädt `webroot/index.html` nach `/var/www/jamulix.de/html/index.html` hoch + (Weiterleitung von `jamulix.de/` auf `/landingpage/`) - Kopiert die Fehlerseiten `landingpage/.html` in den Webroot ### Localhost (zum Testen) @@ -107,7 +108,7 @@ Die E-Mail im Footer (`footer.tsx`) wird als Prop von `app/page.tsx` übergeben: ``` - rsync nach `/var/www/html/landingpage/` -- Symlink: `/var/www/html/index.html` → `landingpage/index.html` +- Kopiert `webroot/index.html` (Weiterleitung) nach `/var/www/html/index.html` - Kopiert die Fehlerseiten in den Webroot - `sudo chown -R www-data:www-data` @@ -134,20 +135,20 @@ Gemeinsames Layout: `components/error-page.tsx`. Der Build erzeugt `/.html`. Alle Asset-Pfade sind absolut (`/landingpage/_next/…`), daher funktionieren die Kopien im Webroot genauso. -Damit Apache sie ausliefert, braucht die vHost-Konfiguration (nicht Teil +Damit nginx sie ausliefert, braucht der `server`-Block (nicht Teil dieses Repos) z. B.: -```apache -ErrorDocument 401 /401.html -ErrorDocument 403 /403.html -ErrorDocument 404 /404.html -ErrorDocument 500 /500.html -ErrorDocument 502 /502.html -ErrorDocument 503 /503.html -ErrorDocument 504 /504.html +```nginx +error_page 401 /401.html; +error_page 403 /403.html; +error_page 404 /404.html; +error_page 500 /500.html; +error_page 502 /502.html; +error_page 503 /503.html; +error_page 504 /504.html; ``` -- `ErrorDocument 401` muss ein lokaler Pfad sein, keine vollständige URL. +- Ziel muss ein lokaler Pfad sein, keine vollständige URL (sonst wird daraus ein Redirect). - Die 401-Seite erscheint erst, wenn der Login-Dialog des Browsers abgebrochen wird. --- diff --git a/deploy_to_localhost.sh b/deploy_to_localhost.sh index b9f023d..4eda4bb 100755 --- a/deploy_to_localhost.sh +++ b/deploy_to_localhost.sh @@ -14,9 +14,11 @@ npm run build echo "Synchronisiere landingpage/ nach /var/www/html/landingpage/..." sudo rsync -av --delete landingpage/ /var/www/html/landingpage/ -echo "Setze symbolischen Link: index.html → landingpage/index.html" +echo "Setze Weiterleitung: index.html → /landingpage/" +# rm zuerst: ein alter Symlink würde sonst landingpage/index.html überschreiben sudo rm -f /var/www/html/index.html -sudo ln -s landingpage/index.html /var/www/html/index.html +sudo cp webroot/index.html /var/www/html/index.html +sudo chown www-data:www-data /var/www/html/index.html echo "Kopiere Fehlerseiten: landingpage/.html → .html" for c in $ERROR_PAGES; do diff --git a/deploy_to_production.sh b/deploy_to_production.sh index e6ea84a..6a3149e 100755 --- a/deploy_to_production.sh +++ b/deploy_to_production.sh @@ -28,8 +28,10 @@ npm run build echo "Synchronisiere landingpage/ nach $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/landingpage/..." rsync -av --delete -e "ssh -S $SSH_SOCKET" landingpage/ "$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/landingpage/" -echo "Setze symbolischen Link: index.html → landingpage/index.html" -ssh -S "$SSH_SOCKET" "$REMOTE_USER@$REMOTE_HOST" "rm -f '$REMOTE_DIR/index.html' && ln -s landingpage/index.html '$REMOTE_DIR/index.html'" +echo "Setze Weiterleitung: index.html → /landingpage/" +# rm zuerst: ein alter Symlink würde sonst landingpage/index.html überschreiben +ssh -S "$SSH_SOCKET" "$REMOTE_USER@$REMOTE_HOST" "rm -f '$REMOTE_DIR/index.html'" +rsync -av -e "ssh -S $SSH_SOCKET" webroot/index.html "$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/index.html" echo "Kopiere Fehlerseiten: landingpage/.html → .html" ssh -S "$SSH_SOCKET" "$REMOTE_USER@$REMOTE_HOST" "for c in $ERROR_PAGES; do cp '$REMOTE_DIR'/landingpage/\$c.html '$REMOTE_DIR'/\$c.html; done" diff --git a/webroot/index.html b/webroot/index.html new file mode 100644 index 0000000..1ec7b4f --- /dev/null +++ b/webroot/index.html @@ -0,0 +1,19 @@ + + + + + + + + jamulix.de + + + + +

Weiter zu jamulix.de/landingpage/

+ +