how to solve Invalid command 'PassengerAppRoot', perhaps misspelled or defined by a module not included in the server configuration?

白昼怎懂夜的黑 提交于 2020-01-06 04:31:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!