[object Object]

← back to Abramsagency

add golive-port-fix.sh: resolve :9788 collision with VenturaClaw — move abramsagency to a free box port + sync vhost

75ee42e5e6a2182ab10cb127e83d2cab9e2dab0f · 2026-08-13 13:53:52 -0700 · Steve Abrams

Files touched

Diff

commit 75ee42e5e6a2182ab10cb127e83d2cab9e2dab0f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 13 13:53:52 2026 -0700

    add golive-port-fix.sh: resolve :9788 collision with VenturaClaw — move abramsagency to a free box port + sync vhost
---
 golive-port-fix.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/golive-port-fix.sh b/golive-port-fix.sh
new file mode 100644
index 0000000..c7ddbcf
--- /dev/null
+++ b/golive-port-fix.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# Fix port collision: move abramsagency to a free port on the box + sync the vhost.
+set -euo pipefail
+SRV=root@45.61.58.125
+ssh -o StrictHostKeyChecking=accept-new "$SRV" 'bash -s' <<'EOS'
+set -e
+DIR=/var/www/agency.agentabrams.com
+VHOST=/etc/nginx/conf.d/agency.agentabrams.com.conf
+# what currently owns 9788?
+echo "== :9788 owner =="; ss -ltnp 2>/dev/null | grep ":9788 " || echo "(nothing? app may be crash-looping)"
+# pick a free port in 9600-9699
+PORT=""
+for p in $(seq 9600 9699); do
+  if ! ss -ltn 2>/dev/null | grep -q ":$p "; then PORT=$p; break; fi
+done
+[ -z "$PORT" ] && { echo "NO FREE PORT"; exit 1; }
+echo "== chosen free PORT=$PORT =="
+# restart our app cleanly on that port
+pm2 delete abramsagency >/dev/null 2>&1 || true
+cd "$DIR" && PORT=$PORT pm2 start server.js --name abramsagency && pm2 save >/dev/null
+sleep 1
+echo "== our app healthz on :$PORT (want service:abramsagency) =="; curl -s -m 5 "http://127.0.0.1:$PORT/healthz"; echo
+# point the vhost at the new port
+sed -i -E "s#proxy_pass http://127.0.0.1:[0-9]+#proxy_pass http://127.0.0.1:$PORT#" "$VHOST"
+nginx -t && systemctl reload nginx && echo RELOADED
+echo "== through nginx https (want abramsagency JSON) =="; curl -s -m 8 https://agency.agentabrams.com/healthz; echo
+EOS

← 155edd3 add golive-finish.sh: full restart (apply specific-IP bind)  ·  back to Abramsagency  ·  fix .deploy.conf: PORT 9788 -> 9632 (real live port after th 1600736 →