﻿# Deployment Guide

## Ubuntu 24.04 Stack
- Install `nginx` or `apache2`
- Install `php8.4`, `php8.4-fpm`, `php8.4-mysql`, `php8.4-mbstring`, `php8.4-json`, `php8.4-curl`
- Install `mysql-server`
- Install `git`

## Nginx Notes
- Set document root to the project directory.
- Deny direct access to `.env`.
- Force HTTPS and redirect HTTP traffic.
- Pass PHP requests through PHP-FPM.

## Apache Notes
- Enable `rewrite`, `headers`, and `ssl` modules.
- Disable directory listing.
- Add security headers and force HTTPS in the vhost.

## Operational Tasks
- Run periodic expiry checks by calling `API/System/server_status.php` and a subscription expiry cron wrapper if you add one.
- Back up MySQL and `storage/logs` daily.
- Monitor API logs for repeated authentication failures and high-rate MT5 traffic.
- Keep gateway secrets and JWT secrets outside version control.
