Skip to main content

Production Deployment

Deploy the Viax platform to a production VPS server with proper security, performance optimization, and monitoring.
Production deployment requires careful attention to security. Never deploy without proper authentication, HTTPS, and security hardening.

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

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:
Content:
Enable Site:

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:
Restart Apache:

Step 7: Verify Deployment


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

  1. Open ios/Runner.xcworkspace in Xcode
  2. Select Runner target
  3. Signing & Capabilities tab
  4. Select your team
  5. Ensure provisioning profile is set
2

Build

3

Archive for App Store

  1. In Xcode: Product > Archive
  2. Wait for archive to complete
  3. Window > Organizer
  4. Select archive > Distribute App
  5. 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

In Apache config:
In php.ini:
Implement rate limiting for API endpoints:

Monitoring & Maintenance

Server Monitoring

Database Backups

Automated Backup Script:
Schedule with Cron:

Update Deployment

Deployment Script:

Troubleshooting

Check Apache error logs:
Common causes:
  • PHP syntax errors
  • Missing file permissions
  • Database connection issues
  • Missing PHP extensions
Test connection:
Check:
  • Credentials in database.php
  • MySQL service running
  • User permissions granted
Production Deployment Complete! Your Viax platform is now live and accessible to users.