You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
grigoryk edited this page Jan 18, 2013
·
6 revisions
Using ssh to access instances
This section will show you how to ssh into an instance and set up the environment so you can run commands with manage.py
Setting up your ssh key
You will need to add your public SSH key to ssh_keys, located in the root folder of the SecondFunnel project.
If you do not have an SSH key, you'll need to create one.
To add your public SSH key, just run the following command:
cat ~/.ssh/id_rsa.pub >> ssh_keys
The deployment process automatically appends ssh keys to the authorized keys file on the instance, which will allow you to SSH onto the machine.
Getting into an instance
In the AWS Console, go to the EC2 page (at the top of the screen: Services -> EC2), click instances on the left navigation bar, then click your instance. Find the instance's public DNS from the options pane that appears.
Now open a terminal and type in ssh ec2-user@<public_dns_from_above> You should now be on the instance.
Setting up the environment
Our code is stored in /opt/python/bundle/#/app/ where # is the highest numbered directory inside bundle (eg. /opt/python/bundle/7/app/). It's also linked from /opt/python/current/. Once in that directory:
cd /opt/python/current/app
source ../../../run/venv/bin/activate
source ../env
The first source is to setup the virtual environment, and the second sets up RDS environment variables. You can now run commands with manage.py.