T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/lavocat.quebec/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.quebec/public_html/DEPLOYMENT_CHECKLIST.md
# 🚀 Deployment Checklist for lavocat.quebec

## 📋 Pre-Deployment Checklist

### ✅ Domain & DNS Setup
- [ ] Domain `lavocat.quebec` is registered and active
- [ ] DNS records are configured:
  - [ ] A record pointing to server IP
  - [ ] CNAME record for `www.lavocat.quebec` → `lavocat.quebec`
  - [ ] MX records for email (if needed)
- [ ] Domain propagation is complete (can take 24-48 hours)

### ✅ Server Preparation
- [ ] Ubuntu/Debian server is set up
- [ ] Server has sufficient resources:
  - [ ] Minimum 2GB RAM
  - [ ] Minimum 20GB storage
  - [ ] Good CPU (2+ cores recommended)
- [ ] Server security is configured:
  - [ ] Firewall (UFW) is enabled
  - [ ] SSH key authentication is set up
  - [ ] Root login is disabled
  - [ ] Fail2ban is installed

### ✅ Software Installation
- [ ] Node.js 18+ is installed
- [ ] npm is installed
- [ ] Apache is installed and configured
- [ ] MySQL is installed and configured
- [ ] SSL certificates are obtained (via DirectAdmin):
  - [ ] Private key: `certificates/lavocat.quebec.key`
  - [ ] Certificate: `certificates/lavocat.quebec.crt`
  - [ ] Certificate chain (if needed)

### ✅ Environment Configuration
- [ ] `.env.production` file is created with correct values:
  - [ ] Database connection string
  - [ ] NextAuth secrets
  - [ ] OAuth provider credentials
  - [ ] Email configuration
  - [ ] Stripe keys (if using payments)
  - [ ] SSL certificate paths

## 🚀 Deployment Steps

### 1. Initial Server Setup
```bash
# Update system
sudo apt update && sudo apt upgrade -y

# Install required software
sudo apt install -y apache2 mysql-server mysql-client

# Install Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install PM2 for process management (optional)
sudo npm install -g pm2
```

### 2. Database Setup
```bash
# Database already created via DirectAdmin
# Hostname: localhost
# Database: gositeme_avocat
# Username: gositeme_avocat
# Password: TDZEMAwNvFznSKQeDkjY

# Test connection
mysql -u gositeme_avocat -pTDZEMAwNvFznSKQeDkjY gositeme_avocat
```

### 3. SSL Certificate Setup
```bash
# Using Let's Encrypt (recommended)
sudo certbot --nginx -d lavocat.quebec -d www.lavocat.quebec

# Or manually place certificates
sudo mkdir -p /var/www/lavocat.quebec/certificates
sudo cp certificates/lavocat.quebec.key /var/www/lavocat.quebec/certificates/
sudo cp certificates/lavocat.quebec.crt /var/www/lavocat.quebec/certificates/
sudo chmod 600 /var/www/lavocat.quebec/certificates/lavocat.quebec.key
sudo chmod 644 /var/www/lavocat.quebec/certificates/lavocat.quebec.crt
```

### 4. Application Deployment
```bash
# Clone or upload your project
cd /var/www
sudo git clone https://github.com/your-repo/lavocat-quebec.git lavocat.quebec
sudo chown -R $USER:$USER lavocat.quebec
cd lavocat.quebec

# Install dependencies
npm ci --only=production

# Generate Prisma client
npx prisma generate

# Run migrations
npx prisma migrate deploy

# Build the application
npm run build:production
```

### 5. Service Configuration
```bash
# Make deployment script executable
chmod +x scripts/deploy-production.sh

# Run deployment script
./scripts/deploy-production.sh
```

### 6. Final Configuration
```bash
# Test nginx configuration
sudo nginx -t

# Reload nginx
sudo systemctl reload nginx

# Start the application service
sudo systemctl start lavocat-quebec
sudo systemctl enable lavocat-quebec

# Check service status
sudo systemctl status lavocat-quebec
```

## 🔧 Post-Deployment Verification

### ✅ Application Health Checks
- [ ] Website loads at https://lavocat.quebec
- [ ] HTTPS redirect works correctly
- [ ] WebSocket connections work
- [ ] Database connections are working
- [ ] File uploads work correctly
- [ ] Authentication system works
- [ ] Email sending works (if configured)

### ✅ Performance Checks
- [ ] Page load times are acceptable (< 3 seconds)
- [ ] Static assets are being served correctly
- [ ] Gzip compression is working
- [ ] SSL certificate is valid and trusted
- [ ] No console errors in browser

### ✅ Security Checks
- [ ] HTTPS is enforced
- [ ] Security headers are present
- [ ] No sensitive information is exposed
- [ ] Rate limiting is working
- [ ] Input validation is working

### ✅ Monitoring Setup
- [ ] Log monitoring is configured
- [ ] Error tracking is set up
- [ ] Performance monitoring is active
- [ ] Backup system is working
- [ ] SSL certificate auto-renewal is configured

## 🛠️ Maintenance Commands

### Service Management
```bash
# Check service status
sudo systemctl status lavocat-quebec

# Restart service
sudo systemctl restart lavocat-quebec

# View logs
sudo journalctl -u lavocat-quebec -f

# Stop service
sudo systemctl stop lavocat-quebec

# Disable service
sudo systemctl disable lavocat-quebec
```

### Nginx Management
```bash
# Test configuration
sudo nginx -t

# Reload configuration
sudo systemctl reload nginx

# Restart nginx
sudo systemctl restart nginx

# View nginx logs
sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
```

### Database Management
```bash
# Connect to MySQL database
mysql -u gositeme_avocat -pTDZEMAwNvFznSKQeDkjY gositeme_avocat

# Run migrations
npx prisma migrate deploy

# Reset database (if needed)
npx prisma migrate reset

# Generate Prisma client
npx prisma generate

# Backup database
npm run backup:database

# Backup with compression
npm run backup:database:compressed
```

### SSL Certificate Management
```bash
# Check certificate status
sudo certbot certificates

# Renew certificates
sudo certbot renew

# Test renewal
sudo certbot renew --dry-run
```

## 🔄 Update Process

### 1. Backup Current Deployment
```bash
sudo cp -r /var/www/lavocat.quebec /var/backups/lavocat.quebec/backup-$(date +%Y%m%d-%H%M%S)
```

### 2. Update Application
```bash
cd /var/www/lavocat.quebec
git pull origin main
npm ci --only=production
npx prisma generate
npx prisma migrate deploy
npm run build:production
```

### 3. Restart Services
```bash
sudo systemctl restart lavocat-quebec
sudo systemctl reload nginx
```

## 🚨 Troubleshooting

### Common Issues
1. **Service won't start**: Check logs with `sudo journalctl -u lavocat-quebec -f`
2. **Database connection errors**: Verify DATABASE_URL in `.env.production`
3. **SSL certificate issues**: Check certificate paths and permissions
4. **Nginx errors**: Check configuration with `sudo nginx -t`
5. **Memory issues**: Monitor with `htop` and adjust Node.js memory limits

### Emergency Rollback
```bash
# Stop current service
sudo systemctl stop lavocat-quebec

# Restore from backup
sudo cp -r /var/backups/lavocat.quebec/backup-YYYYMMDD-HHMMSS /var/www/lavocat.quebec

# Restart service
sudo systemctl start lavocat-quebec
```

## 📞 Support Contacts
- **Domain Registrar**: [Your domain registrar]
- **Hosting Provider**: [Your hosting provider]
- **SSL Certificate Provider**: Let's Encrypt
- **Database Provider**: [Your database provider]

## 📝 Notes
- Keep backups of the entire `/var/www/lavocat.quebec` directory
- Monitor disk space regularly
- Set up automated backups
- Configure log rotation to prevent disk space issues
- Set up monitoring alerts for service downtime 

CasperSecurity Mini