python - Why apache throws Target WSGI script not found or unable to stat on Flask app? -
i want setup flask app apache on ubuntu server using wsgi. after setup, following browser error:
not found requested url / not found on server. the apache error log throws:
target wsgi script not found or unable stat: /var/www/html/appname/appname.wsgi my wsgi file looks this:
#!/usr/bin/python import sys import logging logging.basicconfig(stream=sys.stderr) sys.path.insert(0,"/var/www/html/appname/") ideahound import app application application.secret_key = 'here_the_key' and apache config file looks this:
<virtualhost *:80> servername server_ip_here wsgiscriptalias / /var/www/html/appname/appname.wsgi <directory /var/www/html/appname/> order allow,deny allow </directory> errorlog ${apache_log_dir}/error.log loglevel info customlog ${apache_log_dir}/access.log combined </virtualhost> the appname folder has following structure: appname
--application.py --appname.wsgi --license --readme.md --requirements.txt --db_manage.py --appname ----frontend ----__inity__.py ----__init__.pyc ----models ----__pycache__ ----socket_interface --appname ----__init__.py ----static ----templates --instance ----config.py what missing here make webserver run correctly flask?
please read following link of digital ocean. describe in it. , app , running in 5 mins.
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps
also check apache error logs more information if still throws error.
/var/log/apache2/error.log
Comments
Post a Comment