# Deploy runbook — voiceclone site onto the Voice Realm VPS

For: Dave's developer. Written 2026-07-29.

Goal: stand up the new voiceover tool (PHP 8 + MySQL app, currently running on Dave's PC)
as a private staging site on the same GoDaddy VPS that runs www.thevoicerealm.com,
without touching the live site in any way.

What we already know about the server (thanks for the earlier answers):
PHP 7.2.34, MySQL 8.0.46, Apache with .htaccess rewrites, VPS, deploys via FTP.

## Ground rules

1. The live site stays on PHP 7.2.34 exactly as it is. We install PHP 8 **alongside** it
   (per-vhost via PHP-FPM), never as a replacement. Nothing in the live vhost changes.
2. Take a full VPS snapshot before any install step (Step A). It is our undo button.
3. The new site is staging: real domain + SSL, but not linked from anywhere public.

## What the new site needs from the server

| Requirement | Why |
|---|---|
| PHP **8.1 or newer** (8.3 preferred; dev machine runs 8.3) as FPM, for one vhost only | The app uses PHP 8 syntax throughout |
| PHP extensions: pdo_mysql, curl, mbstring, openssl, fileinfo | DB, API calls, uploads |
| **ffmpeg** (any recent build, 6.x+) on PATH | All audio stitching, exports, watermarking |
| A new MySQL database + dedicated user | App has its own schema (~15 tables); does NOT touch the live DB |
| Subdomain vhost, suggested: `studio.thevoicerealm.com`, docroot = the app's `public/` dir | App keeps config, private audio, and source **above** the docroot by design |
| SSL cert on that subdomain (Let's Encrypt is fine) | Browsers refuse microphone access without HTTPS; voice recording is a core feature |
| Outbound HTTPS allowed (it calls third-party speech APIs) | Voice generation |
| php.ini for this vhost: `upload_max_filesize=64M`, `post_max_size=64M`, `max_execution_time=600`, `memory_limit=256M` | Voice-sample uploads and long audio builds |

## Step A — snapshot

Answered 2026-07-29: GoDaddy already takes daily automatic backups — good, that's our
rollback point. One ask: on the day we run Step C (installs), please note the timestamp of
the most recent backup first, and if the panel offers an on-demand snapshot, trigger one
right before starting so the restore point is minutes old rather than up to a day old.

## Step B — audit (read-only, run and send us the output)

```bash
cat /etc/os-release
df -h
free -m
[ -d /usr/local/cpanel ] && echo "cPanel present"; [ -d /usr/local/psa ] && echo "Plesk present"
apachectl -v 2>/dev/null || httpd -v 2>/dev/null || apache2 -v
php -v
ls /etc/php* /opt/remi /etc/opt/remi 2>/dev/null
command -v ffmpeg && ffmpeg -version | head -1
mysql --version
sudo -n true 2>/dev/null && echo "have sudo" || echo "no sudo / password sudo"
```

This tells us the OS/distro, control panel (or none), disk and RAM headroom, whether a
PHP 8 package source already exists, and whether ffmpeg is already installed. **The exact
install commands for Step C depend on these answers**, so we'll send Step C's command list
as soon as we have this output. (If it's cPanel/WHM, PHP 8 + per-vhost assignment is done
through MultiPHP instead of the command line, and we'll write that version of the steps.)

## Steps C–H — what happens after the audit (outline)

- **C. Install PHP 8.3-FPM + extensions** alongside 7.2 (distro/panel-specific commands to follow).
- **D. Install ffmpeg** (package or static build, depending on distro).
- **E. Create the subdomain vhost** `studio.thevoicerealm.com`: DNS A record to the VPS,
  Apache vhost with docroot at `<app>/public`, this vhost's PHP handler pointed at the
  8.3 FPM pool, then Let's Encrypt SSL. Live site's vhost untouched.
- **F. Create the database**: new schema + dedicated user, least privilege, then import
  the SQL dump we'll supply. (Local dev runs MariaDB; the dump will be pre-checked for
  MySQL 8.0 compatibility before we hand it over.)
- **G. Upload the app** (FTP is fine): the app folder sits ABOVE the docroot, only its
  `public/` is web-served. We'll supply the code as a zip, plus a production
  `config/config.php` separately (it holds API keys — it is never in the zip or in git),
  plus a `media/samples/` folder of approved voice samples. Production config differences:
  server DB credentials, `ffmpeg` path (`/usr/bin/ffmpeg` or wherever D put it), and
  `app.env = 'production'` (this disables the developer auto-login the local copy uses).
- **H. Smoke test together**: load the site over HTTPS, log in, record a voice clone by
  microphone (proves SSL + upload limits), generate a build (proves PHP 8, DB, APIs,
  ffmpeg), run a Casting Call, download an MP3 (proves ffmpeg + file serving).

## Contact

Anything unclear, send questions back through Dave. Nothing after Step B should be run
until we've reviewed the audit output and sent the exact commands.
