I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
""" | |
IAM boto examples: | |
In this example we create a group that provides access | |
to all EC2 and S3 resources and actions and then add a | |
user to that group. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service |
VERSION=2.2.5 | |
apt-get -y install wget | |
rm -rf redis-$VERSION | |
wget http://redis.googlecode.com/files/redis-2.2.5.tar.gz -O redis-$VERSION.tar.gz | |
tar -xzvf redis-$VERSION.tar.gz | |
cd redis-$VERSION | |
./configure --prefix=/usr | |
make | |
rm -rf /tmp/redis-$VERSION.$$ | |
mkdir /tmp/redis-$VERSION.$$ |
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
In [1]: policy = """{ | |
...: "Statement":[{ | |
...: "Effect":"Allow", | |
...: "Action":["s3:*"], | |
...: "Resource":["arn:aws:s3:::mybucket"]}]}""" | |
In [2]: import boto | |
In [4]: c = boto.connect_iam() | |
In [5]: instance_profile = c.create_instance_profile('myinstanceprofile') | |
In [6]: role = c.create_role('myrole') | |
In [7]: c.add_role_to_instance_profile('myinstanceprofile', 'myrole') |