问题
I'm learning how to host my flask app on Apache server. while following these steps Deploying a Python app on a Linux/Unix production server
an while restarting the apache server, got this error
AH00112: Warning: DocumentRoot [/var/www/FlaskApp/FlaskApp/public] does not exist
AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/my_flask_app.conf:
Invalid command 'PassengerAppRoot', perhaps misspelled or defined by a module not included in the server configuration
Action 'restart' failed.
The Apache error log may have more information.
my current configuration is like this
回答1:
try bellow commands
sudo systemctl status -l apache2
If I guess u have to install Passenger thats why it didn't recognize the command . follow below command
sudo apt-get install -y dirmngr gnupg
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update
sudo apt-get install -y libapache2-mod-passenger
sudo a2enmod passenger
sudo apache2ctl restart
##validate the installation########
sudo /usr/bin/passenger-config validate-install
来源:https://stackoverflow.com/questions/59523414/how-to-solve-invalid-command-passengerapproot-perhaps-misspelled-or-defined-b