# Revert Port 7900 Changes

## Steps to Revert

### Step 1: Disable catalyst.syntheon.in Apache Configuration
```bash
sudo a2dissite catalyst.syntheon.in.conf
```

### Step 2: Remove catalyst Configuration File (Optional)
```bash
# Remove from sites-available (optional - you can keep it for future use)
# sudo rm /etc/apache2/sites-available/catalyst.syntheon.in.conf
```

### Step 3: Stop Any Running Services on Port 7900
```bash
# Kill any processes on port 7900
sudo lsof -ti:7900 | xargs sudo kill -9 2>/dev/null
sudo fuser -k 7900/tcp 2>/dev/null

# Or find and kill manually
ps aux | grep -E "(uvicorn|main.py)" | grep 7900
# Then kill the PID if found
```

### Step 4: Reload Apache
```bash
sudo systemctl reload apache2
```

### Step 5: Verify Port 7900 is Free
```bash
sudo netstat -tlnp | grep 7900
# Should return nothing
```

### Step 6: Fix devapp.syntheon.in (Restore Original Functionality)
```bash
# Create HTTP (port 80) configuration for devapp
sudo tee /etc/apache2/sites-available/devapp-http.conf > /dev/null << 'EOF'
<VirtualHost *:80>
    ServerName devapp.syntheon.in
    ServerAlias devapp.syntheon.in
    DocumentRoot /var/www/html/voicebot-web/
    
    <Directory /var/www/html/voicebot-web/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    
    Alias /voicebot-api /var/www/html/voicebot-api
    
    <Directory /var/www/html/voicebot-api>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/usr/local/php83/var/run/php-fpm.sock|fcgi://localhost/"
    </FilesMatch>
    
    ErrorLog ${APACHE_LOG_DIR}/devapp.syntheon.in-error.log
    CustomLog ${APACHE_LOG_DIR}/devapp.syntheon.in-access.log common
</VirtualHost>
EOF

# Enable it
sudo a2ensite devapp-http.conf

# Test and reload
sudo apache2ctl configtest
sudo systemctl reload apache2
```

## Summary of Changes Reverted

✅ Disabled catalyst.syntheon.in Apache site
✅ Stopped any services on port 7900
✅ Restored devapp.syntheon.in to route to voicebot-web

## What Remains

- Configuration files in `/var/www/html/live_calls/` (documentation only, not active)
- The FastAPI code in `/var/www/html/live_calls/homebook/` (not running)

## Verify Everything is Reverted

```bash
# Check Apache sites
sudo apache2ctl -S 2>&1 | grep -E "(catalyst|7900)"

# Check running services
ps aux | grep -E "(7900|uvicorn|main.py)" | grep -v grep

# Check ports
sudo netstat -tlnp | grep 7900

# Test devapp
curl -I http://devapp.syntheon.in/
curl -I https://devapp.syntheon.in/
```

