Production Deployment
Deploy the Viax platform to a production VPS server with proper security, performance optimization, and monitoring.Deployment Overview
Current Production Setup
Server
VPS Details:
- IP: 76.13.114.194
- OS: Linux (Ubuntu/Debian)
- Access: SSH root access
Services
Stack:
- Apache Web Server
- PHP 8.3+
- MySQL 8.0+
- Git for deployments
Backend
Location:
- Path:
/var/www/viax/backend - URL:
http://76.13.114.194 - Repository: GitHub
Database
MySQL:
- Host: localhost
- Database: viax_production
- User: viax_user
Pre-Deployment Checklist
1
Code Review
- All features tested locally
- No hardcoded credentials
- Error handling implemented
- Logging configured
- Code committed to Git
2
Environment Configuration
- Production database credentials ready
- API keys secured
- SMTP settings configured
- Environment variables set
3
Security
- SQL injection prevention (prepared statements)
- XSS protection
- CORS configured
- Input validation
- Password hashing (bcrypt)
4
Performance
- Database indexes created
- Query optimization done
- Caching strategy planned
- Assets optimized
5
Backup
- Database backup created
- Code repository backed up
- Rollback plan documented
Backend Deployment
Step 1: Server Access
Step 2: Initial Server Setup
- Update System
- Install Apache
- Install PHP
- Install MySQL
- Install Composer
Step 3: Deploy Backend Code
1
Create Directory Structure
2
Clone Repository
3
Install Dependencies
4
Set Permissions
Step 4: Configure Apache
Create Virtual Host:Step 5: Configure Database
1
Create Database
2
Import Schema
3
Configure Backend Database Connection
Edit
/var/www/viax/backend/config/database.php:Step 6: Production PHP Configuration
Edit/etc/php/8.3/apache2/php.ini:
Step 7: Verify Deployment
- Health Check
- System Verification
- Test Endpoint
Mobile App Deployment
Android Production Build
1
Configure Build
Edit
android/app/build.gradle:2
Build APK
3
Build App Bundle (Google Play)
iOS Production Build
1
Configure Signing
- Open
ios/Runner.xcworkspacein Xcode - Select Runner target
- Signing & Capabilities tab
- Select your team
- Ensure provisioning profile is set
2
Build
3
Archive for App Store
- In Xcode: Product > Archive
- Wait for archive to complete
- Window > Organizer
- Select archive > Distribute App
- Follow App Store distribution flow
Security Hardening
Firewall Configuration
SSL/TLS Setup (Future)
HTTPS is highly recommended for production. Use Let’s Encrypt for free SSL certificates.
Security Best Practices
Disable Directory Listing
Disable Directory Listing
In Apache config:
Hide PHP Version
Hide PHP Version
In
php.ini:Restrict File Uploads
Restrict File Uploads
Rate Limiting
Rate Limiting
Implement rate limiting for API endpoints:
Monitoring & Maintenance
Server Monitoring
Database Backups
Automated Backup Script:Update Deployment
Deployment Script:Troubleshooting
500 Internal Server Error
500 Internal Server Error
Check Apache error logs:Common causes:
- PHP syntax errors
- Missing file permissions
- Database connection issues
- Missing PHP extensions
Database Connection Failed
Database Connection Failed
Test connection:Check:
- Credentials in database.php
- MySQL service running
- User permissions granted
High Server Load
High Server Load
Production Deployment Complete! Your Viax platform is now live and accessible to users.