Q: mod_wsg with flask and static files served by apache I am trying to setup a apache server with flask apps for APIs.
I want a user accessing mydomain.com to get served the index.html from apache and if making requests to mydomain.com/api flask should serve json.
I can get the index.html just fine but when I visit mydomain.com/api I get 404 not found.
This is my apache config.
<VirtualHost *:80>
        ServerName temp.mydomain.com
        ServerAlias mydomain.com
        ServerAdmin webmaster@mydomain.com

        WSGIDaemonProcess incubator-web user=incubator-web group=www-data home=/var/www/incubator-web threads=5
        WSGIScriptAlias /api/ /var/www/incubator-web/incubator-web.wsgi
        Alias / /var/www/incubator-web/html/

        <Directory /var/www/incubator-web>
                WSGIProcessGroup incubator-web
                WSGIApplicationGroup %{GLOBAL}
                WSGIScriptReloading On
                Require all granted
        </Directory>
        ErrorLog /var/www/incubator-web/logs/error.log

        <Directory /var/www/incubator-web/html>
                Require all granted
        </Directory>
</VirtualHost>

And my flask app:
from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello, World!"

if __name__ == "__main__":
    app.run(host="0.0.0.0")

and my .wsgi file:
#!/usr/bin/python
import sys
sys.path.insert(0, '/var/www/incubator-web')
from incubator_web import app as application

I'm pretty new to all this so I'm guessing that I'm missing something obvious.

A: Remove:
Alias / /var/www/incubator-web/html/

add:
DocumentRoot /var/www/incubator-web/html/

Setting Alias as / hides the WSGI application as Alias takes precendence over WSGIScriptAlias. DocumentRoot is the correct way of specifying the default document directory.
