-
-
Save silpol/10f488fb05563a5b6910 to your computer and use it in GitHub Desktop.
Shell script to get setup with Flask, nginx and uWSGI on an Amazon EC2 Linux image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Shell script to automatically configure a new Flask, nginx and uWSGI based blog | |
# on an Amazon EC2 instance. | |
# | |
# See http://bit.ly/MeGwjD for more information! | |
# | |
# If you are forking this for your own custom configuration script, see the following other gists: | |
# https://gist.github.com/3071737 | |
# https://gist.github.com/3071739 | |
# https://gist.github.com/3071740 | |
# | |
# python26 promoted to python27 | |
sudo yum install python27 python27-devel make automake nginx gcc gcc-c++ python-setuptools git | |
sudo easy_install pip | |
sudo pip install uwsgi virtualenv | |
cd ~ | |
git clone https://github.com/orf/simple.git myblog | |
cd ~/myblog | |
virtualenv venv | |
. venv/bin/activate | |
pip install Flask Flask-SQLAlchemy markdown | |
python create_config.py | |
cd ~ | |
sudo mkdir -p /var/www/run | |
sudo cp -R myblog /var/www/blog | |
sudo chown -R nginx:nginx /var/www/ | |
sudo mkdir -p /var/log/uwsgi | |
sudo mkdir -p /etc/uwsgi/apps-available | |
sudo mkdir -p /etc/uwsgi/apps-enabled | |
# raw gist switched to forked current sample | |
sudo wget https://gist.githubusercontent.com/silpol/ba89b87a65194e87a7d4/raw/e6b20da91d75e9134dcc0b962235c42e8ccdade9/uwsgi.conf /etc/init/uwsgi.conf | |
sudo vim /etc/init/uwsgi.conf | |
# raw gist switched to forked current sample | |
sudo wget https://gist.githubusercontent.com/silpol/1d6f1cabe6dd050be5db/raw/c58c01c0f2876a5fb270bbb7f63639c8e724b190/blog.ini /etc/uwsgi/apps-available/blog.ini | |
sudo vim /etc/uwsgi/apps-available/blog.ini | |
sudo ln -s /etc/uwsgi/apps-available/blog.ini /etc/uwsgi/apps-enabled/blog.ini | |
# raw gist switched to forked current sample | |
sudo wget https://gist.githubusercontent.com/silpol/8d1b2ffc6a001e1d6feb/raw/88e75a41f00d82377fa3bf83a39fdfe7d227c6c3/default.conf /etc/nginx/conf.d/default.conf | |
sudo vim /etc/nginx/conf.d/default.conf | |
sudo service nginx start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment