Q:

Deploying a basic Python 3.4 Flask app on an Ubuntu 14.04 VPS

I'm trying to deploy a WSGI Flask Application to my Ubuntu 14.04 Linode VPS.
I've tried to follow the basic instructions, but when I go to my domain (http://davidystephenson.com), I get the default Apache page.
The app is located in /var/www/davidystephenson. The file structure is:
|----davidystephenson
|--------davidystephenson
|------------static
|------------templates
|------------__init__.py
|--------davidystephenson.wsgi

The __init__.py reads (excuse the line numbers):
import datetime
from flask import Flask

app = Flask(__name__)
@app.route('/')
def hello():
    return 'Hello.'
if __name__ == '__main__':
    app.run()

The davidystephenson.wsgi file reads:
#!/usr/bin/python3

from davidystephenson import app as application

I modified /etc/apache2/sites-available/davidystephenson.conf to read:
<VirtualHost *>
    ServerName davidystephenson

    WSGIDaemonProcess davidystephenson user=www-data group=www-data threads=5
    WSGIScriptAlias / /var/www/davidystephenson/davidystephenson.wsgi

    <Directory /var/www/davidystephenson/davidystephenson>
        WSGIProcessGroup davidystephenson 
        WSGIApplicationGroup %{GLOBAL}
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I've run sudo a2ensite davidystephenson and sudo service apache2 restart. I'm not receiving any visible errors or warings throughout the process. What am I missing? 

A:

ServerName should be the external host name you use to access the site. The value 'davidystephenson' looks very wrong.
The VirtualHost would also normal specify the port number connections are to be accepted on, thus '*:80' and not just '*'.
Suggest you go read the Apache documentation on setting up named virtual hosts.

