mirror of
https://github.com/myronblair/epic-download
synced 2026-06-30 17:51:00 -05:00
7.1 KiB
7.1 KiB
Epic Travel & Expeditions - cPanel Deployment Guide
Overview
This package contains the Epic Travel & Expeditions website configured for cPanel hosting with MySQL database.
Requirements
- cPanel hosting with:
- Python 3.8+ support
- MySQL 5.7+ or MariaDB 10.3+
- Apache with mod_rewrite enabled
- SSL certificate (recommended)
- At least 500MB disk space
- PHP 7.4+ (optional, for phpMyAdmin)
Package Contents
epic-travel-cpanel/
├── backend/ # Python FastAPI backend
│ ├── routes/ # API endpoints
│ ├── models/ # Database models
│ ├── server.py # Main application
│ ├── requirements.txt # Python dependencies
│ └── .env.example # Environment template
├── frontend/ # React frontend (production build)
│ ├── build/ # Compiled React app
│ └── .htaccess # Apache configuration
├── database_schema.sql # MySQL database schema
├── setup_admin.py # Admin user setup script
└── INSTALLATION.md # This file
Installation Steps
Step 1: Database Setup
-
Create MySQL Database
- Log into cPanel → MySQL Databases
- Create new database:
username_epic_travel - Create database user with strong password
- Grant ALL PRIVILEGES to the user
-
Import Database Schema
- Go to phpMyAdmin
- Select your database
- Click "Import" tab
- Upload
database_schema.sql - Click "Go"
-
Generate Admin Password Hash
cd backend python3 setup_admin.py- Copy the generated hash
- Update the admin_users INSERT statement in the SQL file if needed
Step 2: Backend Setup
-
Upload Backend Files
- Upload
backend/folder to your cPanel account - Recommended location:
~/epic-travel-api/
- Upload
-
Install Python Dependencies
cd ~/epic-travel-api python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Configure Environment
- Copy
.env.exampleto.env - Edit
.envwith your settings:
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_DATABASE=username_epic_travel MYSQL_USER=username_dbuser MYSQL_PASSWORD=your_secure_password JWT_SECRET_KEY=your_random_256bit_key ADMIN_DEFAULT_PASSWORD=Joker1974!!! CORS_ORIGINS=https://yourdomain.com - Copy
-
Setup Python Application
- In cPanel → Setup Python App
- Python version: 3.8+
- Application root:
/home/username/epic-travel-api - Application URL:
/api - Application startup file:
server.py - Application Entry point:
app - Click "Create"
-
Install Dependencies via cPanel
- In the Python App configuration
- Click "Run pip install" button
- Or run:
pip install -r requirements.txt
Step 3: Frontend Setup
-
Upload Frontend Build
- Upload contents of
frontend/build/to your public_html - Or to a subdomain folder
- Upload contents of
-
Configure .htaccess
- Ensure
.htaccessis present in the root - Modify if your API is on a different path
- Ensure
-
Update API URL
- In
public_html/static/js/main.*.js - Or set via environment variable during build
- In
Step 4: SSL Configuration
-
Enable SSL
- In cPanel → SSL/TLS
- Install Let's Encrypt certificate (free)
- Enable "Force HTTPS Redirect"
-
Update CORS
- Edit backend
.env - Set:
CORS_ORIGINS=https://yourdomain.com - Restart Python application
- Edit backend
Step 5: Testing
-
Test Backend API
curl https://yourdomain.com/apiShould return:
{"message": "Epic Travel API is running", "status": "healthy"} -
Test Frontend
- Visit: https://yourdomain.com
- Should see Epic Travel homepage
-
Test Admin Login
- Visit: https://yourdomain.com/admin
- Login with:
- Email: admin@epictravel.com
- Password: Joker1974!!!
Configuration Files
Backend .env
# Database Configuration
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=username_epic_travel
MYSQL_USER=username_dbuser
MYSQL_PASSWORD=your_password
# Security
JWT_SECRET_KEY=generate_with_openssl_rand_hex_32
ADMIN_DEFAULT_PASSWORD=Joker1974!!!
# CORS
CORS_ORIGINS=https://yourdomain.com
Frontend .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# API Proxy
RewriteCond %{REQUEST_URI} ^/api/(.*)$
RewriteRule ^api/(.*)$ https://yourdomain.com/api/$1 [P,L]
# React Router
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]
</IfModule>
Troubleshooting
Backend not starting
- Check Python version:
python3 --version - Check error logs in cPanel
- Verify MySQL connection details
- Ensure all dependencies installed
Frontend shows blank page
- Check browser console for errors
- Verify API URL in frontend build
- Check .htaccess file exists
- Clear browser cache
Database connection fails
- Verify MySQL credentials
- Check if database user has proper privileges
- Ensure MySQL server is running
- Check host (use 'localhost' not '127.0.0.1')
CORS errors
- Update CORS_ORIGINS in backend .env
- Restart Python application
- Check SSL configuration
- Ensure frontend and backend use same protocol (HTTPS)
Performance Optimization
-
Enable Gzip Compression
- Add to .htaccess:
<IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json </IfModule> -
Enable Browser Caching
- Add to .htaccess:
<IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" </IfModule> -
MySQL Optimization
- Add indexes to frequently queried columns
- Use connection pooling
- Enable query caching
Maintenance
Updating the Application
- Backup database: Export via phpMyAdmin
- Backup files: Download via FTP
- Upload new files
- Run any database migrations
- Restart Python application
Database Backup
mysqldump -u username -p username_epic_travel > backup_$(date +%Y%m%d).sql
Monitoring
- Check error logs in cPanel
- Monitor disk space usage
- Review database size
- Check Python app status
Support
For issues specific to this application:
- Check logs in cPanel
- Verify all configuration settings
- Ensure MySQL connection is working
- Test API endpoints individually
Security Checklist
- Strong MySQL password set
- JWT secret key generated and set
- Admin password changed from default
- SSL certificate installed
- HTTPS redirect enabled
- CORS properly configured
- File permissions set correctly (644 for files, 755 for directories)
- .env file protected (not web-accessible)
Credits
Epic Travel & Expeditions Contact: advisor@epictravelexpeditions.com Phone: +1 (817) 266-2022