Skip to content

Instantly share code, notes, and snippets.

@benfb benfb/lyricloud_setup.md
Last active Aug 29, 2015

Embed
What would you like to do?
lyricloud_setup

On Nginx

adduser ben
gpasswd -a ben sudo
su - ben
mkdir .ssh
chmod 700 .ssh
vim .ssh/authorized_keys # add person key to file
vim /etc/ssh/sshd_config: PermitRootLogin no
sudo apt-get update
sudo apt-get install git python-pip python-dev nginx libxml2-dev libxslt1-dev zlib1g-dev libfreetype6-dev libjpeg-dev
git clone https://github.com/benfb/albumcloud.git lyricloud
cd lyricloud
sudo pip install virtualenv
virtualenv lyricloudenv
source lyricloudenv/bin/activate
pip install cython
pip install git+git://github.com/amueller/word_cloud.git
pip install -r requirements.txt
deactivate

/etc/init/lyricloud.conf:

description "uWSGI server instance configured to serve myproject"

start on runlevel [2345]
stop on runlevel [!2345]

setuid ben
setgid www-data
env PATH=/home/ben/lyricloud/lyricloudenv/bin
chdir /home/ben/lyricloud
exec uwsgi --ini lyricloud.ini

/etc/nginx/sites-available/lyricloud:

server {
    listen 80;
    server_name lyricloud.333vinyl.us;

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/home/ben/lyricloud/lyricloud.sock;
	uwsgi_read_timeout 600;
	uwsgi_send_timeout 600;
    }
}
sudo ln -s /etc/nginx/sites-available/lyricloud /etc/nginx/sites-enabled
sudo chown -R ben:www-data .
sudo chmod -R 0755 .
sudo service nginx restart
sudo start lyricloud

On Heroku

  1. Locally:
virtualenv venv
source venv/bin/activate
pip install cython
pip install git+git://github.com/amueller/word_cloud.git
pip install flask
pip install lxml
pip install numpy
pip install pillow
pip install BeautifulSoup
pip freeze > requirements.txt
  1. commit a requirements file without word_cloud
  2. then add word_cloud in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.