How to host a Flask app on Amazon AWS in 5 minutes ?

Apache Configuration for Amazon AWS

Location:- /etc/apache2/sites-available/

NameVirtualHost *:80

WSGIScriptAlias / /var/www/aira/aira/aira/aira.wsgi

Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel info
CustomLog ${APACHE_LOG_DIR}/access.log combined

Enable the above file which we created.

sudo a2ensite
sudo a2dissite 000-default
Location of :- /var/www/aira/aira/aira/
Location of .wsgi:- /var/www/aira/aira/aira/aira.wsgi

Content of aira.wsgi
import sys
sys.path.insert(0, ‘/var/www/aira/aira/aira’)
from app import app as application

sudo /etc/init.d/apache2 reload
tail -500 /var/log/apache2/error.log

Shoot me a mail if it takes more than 5 minutes 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *