I'm trying to Running Flask with Apache2 and Mod-WSGI in my raspberry I got The requested URL that was not found on this server I try to edit 000-default.conf but app won't with Mod-WSGI. I used python 3
can someone let me know what is the problem?
thank you this is my status from apache2:
this is app.wsgi :
#!/usr/bin/python3
import sys
sys.path.insert(0, '/var/www/html/prox')
from init import app as application
this is 000-default.conf
Listen 5000
<VirtualHost *:5000>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/prox
LogLevel debug
WSGIScriptAlias / /var/www/html/prox/app.wsgi
WSGIDaemonProcess prox processes=5 threads=1 user=pi group=pi display-name=%{GROUP}
WSGIProcessGroup prox
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIChunkedRequest On
ErrorLog ${APACHE_LOG_DIR}/error-5000.log
CustomLog ${APACHE_LOG_DIR}/access-5000.log combined
<Directory /var/www/html/prox>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
this the app: named app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home_page():
return render_template('index.html')
app.debug = True
if __name__ == '__main__'
app.run()
I got this error
Try starting the flask app itself on your apache server, for example.
// Find your flask app
export FLASK_APP=<YOUR_FILE>
// Host it on your local network
flask run --host=0.0.0.0
This will start the server, makes sure you are in the virtual environment and directory your flask app is stored in.