Reputation: 41
I am trying to deploy a FastAPI application on a cPanel-managed server using Phusion Passenger with Apache. However, Passenger is not detecting my app even after following the standard setup.
What I Have Done So Far:
sudo PASSENGER_INSTANCE_REGISTRY_DIR=/opt/cpanel/ea-ruby27/root/var/run/passenger-instreg /usr/sbin/passenger-status
Output: Passenger is running, but my app is not listed.
Checked Passenger's expected WSGI setup-> My passenger_wsgi.py file contains:
import sys
import os
from main import app
from mangum import Mangum # Converts ASGI to WSGI
sys.path.insert(0, os.path.dirname(__file__))
application = Mangum(app) # Passenger expects 'application'
Installed mangum via pip install mangum
Created a Passenger config file:
PassengerEnabled on
PassengerAppRoot /home/rgano/public_html/dplF/myproj
PassengerPython /usr/bin/python3
PassengerAppType wsgi
PassengerStartupFile passenger_wsgi.py
Restarted Apache and Passenger:
sudo touch /home/rgano/public_html/dplF/myproj/tmp/restart.txt
sudo systemctl restart httpd
Checked for errors in Apache logs:
sudo tail -f /var/log/apache2/error_log
No signifact erros found related to my app
Problem: Despite following these steps, my app is not appearing in passenger-status and is not accessible via my domain (https://0rgano.com/dplF/myproj).
However, my hosting provider successfully deployed another Python app (testpyapp) using Passenger, so the issue seems to be specific to my FastAPI setup.
Upvotes: 0
Views: 22