# Fix devapp.syntheon.in Issue

## Problem
- Apache service is in **failed state**
- `devapp.syntheon.in` is not routing to `/var/www/html/voicebot-web/`
- Connection refused on ports 80 and 443

## Root Cause
Apache failed to start. There might be a configuration conflict or error.

## Solution Steps

### Step 1: Check Apache Configuration Syntax
```bash
sudo apache2ctl configtest
```

### Step 2: Check if devapp-syntheon.conf is Enabled (Conflict)
The file `/etc/apache2/sites-available/devapp-syntheon.conf` is trying to proxy to port 7900 (FastAPI), but `devapp.syntheon.in` should serve Laravel from `/var/www/html/voicebot-web/`.

**Check if it's enabled:**
```bash
ls -la /etc/apache2/sites-enabled/ | grep devapp-syntheon
```

**If enabled, disable it (it's for FastAPI, not Laravel):**
```bash
sudo a2dissite devapp-syntheon.conf
```

### Step 3: Verify 000-default.conf Has Correct Configuration
The file `/etc/apache2/sites-enabled/000-default.conf` should have:
- Port 443: `ServerName devapp.syntheon.in` with `DocumentRoot /var/www/html/voicebot-web/`

### Step 4: Add HTTP (Port 80) Configuration for devapp.syntheon.in
Currently, port 80 doesn't have a ServerName for devapp. Add this to 000-default.conf:

```apache
<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>
```

### Step 5: Start Apache
```bash
sudo systemctl start apache2
sudo systemctl status apache2
```

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

## Current Configuration Status

✅ **Port 443 (HTTPS)**: Correctly configured in 000-default.conf
- ServerName: devapp.syntheon.in
- DocumentRoot: /var/www/html/voicebot-web/
- SSL: Configured

❌ **Port 80 (HTTP)**: Missing ServerName for devapp.syntheon.in
- Currently uses default virtual host
- Needs explicit configuration

## Quick Fix Command

```bash
# 1. Disable conflicting config (if enabled)
sudo a2dissite devapp-syntheon.conf 2>/dev/null

# 2. Test configuration
sudo apache2ctl configtest

# 3. Start Apache
sudo systemctl start apache2

# 4. Check status
sudo systemctl status apache2
```

