# VIRUS Portal — Quick Install Guide

**Domain:** thepanonline.com  
**Server:** 94.136.186.140 (Hetzner BotPrint server)  
**Database:** thepanonline_find  
**DB User:** thepanonline_find  
**DB Password:** thepanonline_find  

---

## ⚡ Quick 5-Minute Install

### STEP 1 — Hostinger DNS (already noted)

1. Hostinger DNS panel khulo (thepanonline.com)
2. Edit existing A record: `@` → `94.136.186.140` (was `2.57.91.91`)
3. Delete CNAME `www`
4. Add new A record: `www` → `94.136.186.140`
5. TTL: `300` for both

Wait 5-15 min for DNS propagation.

### STEP 2 — WHM mein cPanel Account Create

1. WHM login: `https://94.136.186.140:2087`
2. **Account Functions → Create a New Account**
3. Fill:
   - Domain: `thepanonline.com`
   - Username: `thepanonl` (cPanel limit 8 chars)
   - Password: (strong password — note it down)
   - Email: `admin@thepanonline.com`
4. **Create**

### STEP 3 — Database Create

cPanel login → **MySQL Databases** section:

1. **Create New Database:**
   - Name: `find` (full will become `thepanonl_find`) 
   - **OR** Skip the prefix if WHM allows: name exactly `thepanonline_find`
   
2. **Create New User:**
   - Username: `find` (full will become `thepanonl_find`)
   - Password: `thepanonline_find`
   
3. **Add User to Database** with **ALL PRIVILEGES**

⚠️ **IMPORTANT:** cPanel automatically adds prefix (e.g., `thepanonl_`) to DB names. Check actual full names after creation. If full DB name becomes `thepanonl_find` not `thepanonline_find`, you must update `config/config.php` accordingly.

### STEP 4 — Upload ZIP & Extract

**Option A — cPanel File Manager (Easy):**
1. cPanel → **File Manager** → `public_html/` folder
2. Click **Upload** → upload `virus_portal.zip`
3. Right-click ZIP → **Extract** → to current location
4. Open extracted `virus_portal/` folder → **Select All** → **Move** → destination: `/public_html/`
5. Delete empty `virus_portal/` folder and the ZIP

**Option B — SSH (Fast):**
```bash
ssh thepanonl@94.136.186.140
cd public_html
# Upload ZIP via SFTP first, then:
unzip virus_portal.zip
mv virus_portal/* .
mv virus_portal/.htaccess .
rmdir virus_portal
rm virus_portal.zip
```

### STEP 5 — Import Database

1. cPanel → **phpMyAdmin**
2. Select database `thepanonl_find` (or whatever full name is)
3. Click **Import** tab
4. Choose file: `database.sql` (from `public_html/`)
5. Click **Go**

✅ 17 tables banengi + default admin + demo partner + all settings + parent API key + MonkeyPay token pre-filled

### STEP 6 — Verify config.php

Check `public_html/config/config.php`:
```php
define('DB_HOST', 'localhost');
define('DB_USER', 'thepanonline_find');     // CHANGE if cPanel added prefix → thepanonl_find
define('DB_PASS', 'thepanonline_find');
define('DB_NAME', 'thepanonline_find');     // CHANGE if cPanel added prefix → thepanonl_find
```

Edit if cPanel added prefix. Common case: cPanel might force prefix like `thepanonl_find`. Update values then save.

### STEP 7 — SSL Certificate

cPanel → **SSL/TLS Status** → Run **AutoSSL** → Wait 2-5 min  
Verify: `https://thepanonline.com` shows green padlock

### STEP 8 — File Permissions

cPanel → File Manager → select folders `uploads/` and `logs/` → **Permissions** → `0775`

OR via SSH:
```bash
cd /home/thepanonl/public_html
chmod -R 775 uploads/ logs/
```

### STEP 9 — Setup Cron Jobs

cPanel → **Cron Jobs** → Add (4 cron):

```
*/2 * * * * /usr/local/bin/php /home/thepanonl/public_html/cron/sync_parent_status.php > /dev/null 2>&1

*/5 * * * * /usr/local/bin/php /home/thepanonl/public_html/cron/auto_refund.php > /dev/null 2>&1

*/10 * * * * /usr/local/bin/php /home/thepanonl/public_html/cron/send_webhooks.php > /dev/null 2>&1

0 3 * * * /usr/local/bin/php /home/thepanonl/public_html/cron/cleanup_old_logs.php > /dev/null 2>&1
```

(Replace `thepanonl` with your actual cPanel username if different)

### STEP 10 — Test!

Visit: `https://thepanonline.com`

**Admin Login:**
- URL: `https://thepanonline.com/admin/login.php`
- Email: `admin@thepanonline.com`
- Password: `admin@123` ← **CHANGE THIS IMMEDIATELY**

**Demo Partner Login (for testing):**
- URL: `https://thepanonline.com/login.php`
- Email: `demo@thepanonline.com`
- Password: `test@123`
- Initial balance: ₹1000

---

## ✅ Pre-configured Values (Already in DB)

| Key | Value |
|-----|-------|
| Parent API Key (find.vlefastpan.in) | `8007add19c66128fb181d15f2f8ba4ec` |
| TheMonkeyPay Token 2 (backup) | `8ee985fc719e23b27d9d7aba1aebb0de19fc8e49edc20b3d` |
| TheMonkeyPay Username | `6200969381` |
| TheMonkeyPay URL | `themonkeypay.in` |

---

## ⚠️ Post-Install Tasks

1. **Change admin password** (admin panel → Settings)
2. **Delete demo partner** OR change its password
3. **Update bank details** (Admin → System Settings → Payment category)
4. **Register parent webhook** at find.vlefastpan.in admin:
   ```
   https://thepanonline.com/api/parent_webhook.php
   ```
5. **Register MonkeyPay webhook** at gateway provider:
   ```
   https://thepanonline.com/api/monkeypay_webhook.php
   ```

---

## 🛠 Troubleshooting

**"DB Connection failed" error:**  
→ cPanel ne prefix add kiya hai. config.php mein full DB name + user check karein.

**White page on homepage:**  
→ `.htaccess` rewrite issue. Try directly: `https://thepanonline.com/public/index.php`

**Cron not running:**  
→ PHP path different ho sakta hai. Try: `/opt/cpanel/ea-php82/root/usr/bin/php` instead of `/usr/local/bin/php`

**SSL not working:**  
→ DNS abhi propagate nahi hua. 30 min wait karke AutoSSL re-run karein.

**Login fails with "Invalid password":**  
→ Password hash issue. SSH/phpMyAdmin se manually reset:
```sql
UPDATE admin_users SET password='$2b$10$A4bTKxv3A9wOlGruecE7fOIxnDV3RuHJR0JfDJKdXJES5SM5NOOmC' WHERE id=1;
```
(This sets password back to `admin@123`)

---

**Bas itna hi! Website live ho jayegi sir.** 🎉
