Chapter 1. Setting the Stage
This project focused on migrating BRIX Performance's web infrastructure from shared hosting to a VPS-based environment. The migration was driven by real system risks discovered during payment gateway development, where shared hosting limitations caused MySQL throttling and resource instability. The goal was to improve reliability, gain full control over server resources, and prepare a stronger production foundation for future development.
This work was delivered in collaboration with Direct Client.
Chapter 2. Carrying the Work
Responsibilities in this project included Identified shared hosting limitations during payment gateway development, Proposed migration from shared hosting to VPS, Set up VPS environment from scratch, Configured Linux user access, SSH key authentication, and root login restriction, Installed and configured Nginx, PHP-FPM, MySQL, and SSL, Translated Apache .htaccess routing rules into Nginx server configuration, Configured Cloudflare DNS, proxy, CDN, and basic protection layer, Created Git-based deployment workflow using git pull, Configured MySQL database, user privileges, and secure DBeaver access via SSH tunnel, and Debugged DNS, firewall, HTTPS, and database access issues during migration.
Chapter 3. What Changed
The migration successfully moved BRIX Performance from shared hosting into a controlled VPS environment. The website now runs with Nginx, HTTPS, MySQL, Git-based deployment, and Cloudflare protection. Beyond the technical migration, this project also created a stronger understanding of production infrastructure and reduced dependency on shared hosting limitations.
Chapter 4. The Problem and the Response
Problem
The website was previously hosted on shared hosting, which introduced resource limitations such as MySQL throttling and potential performance impact from other users on the same server. During payment gateway development, these limitations created system instability and raised production risk.
Solution
The system was migrated to a VPS environment with dedicated control over web server configuration, database setup, deployment flow, firewall rules, SSL, and Cloudflare integration. This provided a more stable and scalable foundation for future production usage.
Chapter 5. How It Was Built
The migration changed the project from a shared hosting setup into a VPS-based production environment with manual infrastructure control.
Infrastructure Setup: Cleaned existing DNS records and moved the domain to Cloudflare Created A records for root domain and www pointing to the VPS IP Created a non-root Linux user and configured SSH key authentication Disabled root login for better server access security Installed Nginx, PHP-FPM, MySQL, and Certbot Configured Nginx server block for BRIX Performance Translated existing .htaccess rewrite rules into Nginx rules Opened required firewall ports at VPS provider level Generated HTTPS certificate using Let's Encrypt Enabled Cloudflare proxy and CDN
Implementation details included Nginx was used as the main web server instead of Apache, PHP-FPM 8.3 was used to process PHP requests, MySQL was configured with a dedicated application database and user, Database access from local machine was handled through SSH tunnel instead of exposing port 3306 publicly, The deployment workflow was simplified into GitHub push and server-side git pull, Firewall rules were configured for SSH, HTTP, and HTTPS, and Cloudflare was used as DNS, CDN, and protection layer.
This migration improved the stability of the project and created a stronger foundation for future features, including payment gateway deployment and multi-service architecture.
Chapter 6. Application Flow
Production Request Flow: User accesses brix-performance.com through the browser Cloudflare handles DNS, proxy, CDN, and protection layer Request is forwarded to the VPS Nginx routes the request to the PHP application PHP application communicates with MySQL through localhost Response is returned back through Nginx and Cloudflare
Deployment Flow: Code changes are pushed to GitHub Server pulls the latest changes using git pull Nginx serves the updated application from /var/www/brix-performance Configuration is reloaded when needed