142 lines
2.7 KiB
Markdown
142 lines
2.7 KiB
Markdown
|
|
# ⚡ Quick Start Guide - Hosting Platform
|
||
|
|
|
||
|
|
> **For detailed information, see [DEPLOYMENT.md](./DEPLOYMENT.md)**
|
||
|
|
|
||
|
|
## 🎯 Most Common Tasks
|
||
|
|
|
||
|
|
### 1. Deploy Latest Code to Production
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# From local machine
|
||
|
|
cd /Users/oguzozturk/AgumentProje/HostingProjesi/MusteriPanel
|
||
|
|
git add -A
|
||
|
|
git commit -m "Your message"
|
||
|
|
git push
|
||
|
|
|
||
|
|
# On server
|
||
|
|
ssh -i ~/.ssh/id_rsa root@176.96.129.77
|
||
|
|
cd /opt/hosting-platform
|
||
|
|
git fetch origin && git reset --hard origin/main
|
||
|
|
supervisorctl restart hosting-backend
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. Check if Everything is Running
|
||
|
|
|
||
|
|
```bash
|
||
|
|
ssh -i ~/.ssh/id_rsa root@176.96.129.77
|
||
|
|
|
||
|
|
# Check services
|
||
|
|
supervisorctl status
|
||
|
|
|
||
|
|
# Check health
|
||
|
|
curl http://localhost:5000/health
|
||
|
|
|
||
|
|
# Check logs
|
||
|
|
tail -f /var/log/hosting-backend.log
|
||
|
|
```
|
||
|
|
|
||
|
|
### 3. Run Database Migration
|
||
|
|
|
||
|
|
```bash
|
||
|
|
ssh -i ~/.ssh/id_rsa root@176.96.129.77
|
||
|
|
cd /opt/hosting-platform
|
||
|
|
sudo -u postgres psql -d hosting -f backend/migrations/YOUR_FILE.sql
|
||
|
|
supervisorctl restart hosting-backend
|
||
|
|
```
|
||
|
|
|
||
|
|
### 4. View Logs
|
||
|
|
|
||
|
|
```bash
|
||
|
|
ssh -i ~/.ssh/id_rsa root@176.96.129.77
|
||
|
|
|
||
|
|
# Backend logs
|
||
|
|
tail -f /var/log/hosting-backend.log
|
||
|
|
tail -f /var/log/admin-backend.log
|
||
|
|
|
||
|
|
# Nginx logs
|
||
|
|
tail -f /var/log/nginx/error.log
|
||
|
|
```
|
||
|
|
|
||
|
|
### 5. Restart Services
|
||
|
|
|
||
|
|
```bash
|
||
|
|
ssh -i ~/.ssh/id_rsa root@176.96.129.77
|
||
|
|
|
||
|
|
# Customer backend
|
||
|
|
supervisorctl restart hosting-backend
|
||
|
|
|
||
|
|
# Admin backend (manual)
|
||
|
|
pkill -f 'admin-panel/backend'
|
||
|
|
cd /opt/admin-panel/backend && source venv/bin/activate
|
||
|
|
nohup python -m app.main > /var/log/admin-backend.log 2>&1 &
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🔗 Quick Links
|
||
|
|
|
||
|
|
- **Customer Panel**: https://panel.argeict.net
|
||
|
|
- **Admin Panel**: https://admin.argeict.net
|
||
|
|
- **Gitea**: https://gitea.argeict.net
|
||
|
|
- **Server IP**: 176.96.129.77
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📁 Important Paths
|
||
|
|
|
||
|
|
- **Project**: `/opt/hosting-platform/`
|
||
|
|
- **Admin Panel**: `/opt/admin-panel/`
|
||
|
|
- **Logs**: `/var/log/hosting-*.log`
|
||
|
|
- **Nginx Config**: `/etc/nginx/sites-available/`
|
||
|
|
- **Supervisor Config**: `/etc/supervisor/conf.d/`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🗄️ Database Quick Access
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# List databases
|
||
|
|
sudo -u postgres psql -l
|
||
|
|
|
||
|
|
# Connect to main database
|
||
|
|
sudo -u postgres psql -d hosting
|
||
|
|
|
||
|
|
# Quick queries
|
||
|
|
sudo -u postgres psql -d hosting -c "SELECT * FROM customers;"
|
||
|
|
sudo -u postgres psql -d hosting -c "SELECT * FROM cloudflare_accounts;"
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🆘 Emergency Commands
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# If backend is stuck
|
||
|
|
supervisorctl restart hosting-backend
|
||
|
|
|
||
|
|
# If git pull fails
|
||
|
|
cd /opt/hosting-platform
|
||
|
|
git fetch origin && git reset --hard origin/main
|
||
|
|
|
||
|
|
# If database is locked
|
||
|
|
sudo systemctl restart postgresql
|
||
|
|
|
||
|
|
# If Nginx has issues
|
||
|
|
nginx -t && systemctl restart nginx
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📚 Read This First
|
||
|
|
|
||
|
|
**Before any deployment or debugging:**
|
||
|
|
1. Read [DEPLOYMENT.md](./DEPLOYMENT.md) for complete details
|
||
|
|
2. Check current running processes
|
||
|
|
3. Review recent logs
|
||
|
|
4. Test locally before deploying
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Last Updated**: 2026-01-12
|
||
|
|
|