# CloudCare Step 11 — cPanel setup (cloudcare.live)

**Isolated marketing Passenger app — does NOT modify app.cloudcare.live**

## 1. Upload package

Upload folder to server:

```
/home/hostap/cloudcare/cloudcare-marketing-6702d60c-20260704/
```

## 2. Document root

| Setting | Value |
|---------|-------|
| Domain | `cloudcare.live` |
| Document root | `/home/hostap/cloudcare.live` |

Run deploy (dry run first):

```bash
cd /home/hostap/cloudcare/cloudcare-marketing-6702d60c-20260704
chmod +x deploy-marketing.sh rollback-marketing.sh
export PACKAGE_DIR="$(pwd)"
export MARKETING_LIVE=/home/hostap/cloudcare.live
export DRY_RUN=1
./deploy-marketing.sh
```

Then `export DRY_RUN=0` and run again.

## 3. Node.js application (cPanel)

**Setup Node.js App → Create Application**

| Field | Value |
|-------|-------|
| Node.js version | 20.x |
| Application mode | Production |
| Application root | `cloudcare.live` |
| Application URL | `cloudcare.live` |
| Startup file | `server.js` |

Copy environment variables from `ENV.production.marketing`.

**Restart** the application.

## 4. www redirect

**cPanel → Domains → Redirects**

| From | To | Type |
|------|-----|------|
| `https://www.cloudcare.live/` | `https://cloudcare.live/` | Permanent (301) |

Or use `apache/www-to-apex.htaccess` in www docroot.

## 5. Disable directory index

Copy `apache/disable-index.htaccess` → `/home/hostap/cloudcare.live/.htaccess` (if not managed by Passenger).

## 6. Verify

```bash
curl -s https://cloudcare.live/health | jq .
curl -sI https://www.cloudcare.live/ | grep -i location
curl -sI https://app.cloudcare.live/health | head -3
```

Expected:

- `cloudcare.live/` → marketing HTML (not "Index of /")
- `cloudcare.live/health` → JSON with BUILD_ID `Fa3gnM6jAisQwI0G7pAIN`
- `www` → 301 to apex
- `app.cloudcare.live` → unchanged
