# Commands to fix Apache configuration for app2.syntheon.in/livekit_frontend/ # Step 1: Backup current config sudo cp /etc/apache2/sites-enabled/app2.syntheon.in.conf /var/www/html/livekit_frontend/app2.syntheon.in.conf.backup # Step 2: Update the Apache config sudo bash -c 'cat > /etc/apache2/sites-enabled/app2.syntheon.in.conf << '\''EOF'\'' ServerAdmin admin@mcube.com ServerName app2.syntheon.in ServerAlias app2.syntheon.in DocumentRoot /var/www/html # Proxy /livekit_frontend/ to Next.js app on port 3000 with /voicebot basePath ProxyPreserveHost On ProxyPass http://localhost:3000/voicebot ProxyPassReverse http://localhost:3000/voicebot # WebSocket support for LiveKit RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule ^/livekit_frontend/(.*)$ ws://localhost:3000/voicebot/$1 [P,L] # Default directory for other paths Options -Indexes +FollowSymLinks AllowOverride All Require all granted SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost/" ErrorLog ${APACHE_LOG_DIR}/app2.syntheon.in-error.log CustomLog ${APACHE_LOG_DIR}/app2.syntheon.in-access.log combined SSLEngine on Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/app2.syntheon.in/fullchain.pem SSLCertificateKeyKey /etc/letsencrypt/live/app2.syntheon.in/privkey.pem EOF' # Step 3: Test configuration sudo apache2ctl configtest # Step 4: Reload Apache (if test passes) sudo systemctl reload apache2 # Step 5: Verify Next.js is running on port 3000 ss -tlnp | grep :3000 # Step 6: Test the URL curl -I https://app2.syntheon.in/livekit_frontend/ echo "Done! Access your app at: https://app2.syntheon.in/livekit_frontend/"