Setting up EC2 for Django

410 views
Skip to first unread message

Soviet

unread,
Jul 2, 2011, 10:14:35 AM7/2/11
to Django users
Hello
I need to set up EC2 instance to run Django+Python+PostgreSQL+Apache
+Solr+nginx+Mercurial etc. This is all black magic for me - I was only
using shared hosting like webfaction, where everything is dumb-
friendly :). But you know, "the customer is always right", and I have
to run it on Amazon. I did hours of googling, but everything is either
old/outdated or doesn't cover the tools I have to install. So far I'm
stuck on connecting to my instance through PuTTY :D.

Can anyone provide some useful link or step by step tutorial? I have
no experience using Unix command-line-stuff, but im a fast learner :).
Any help would be appreciated. Also, beer is on me when we meet! :)

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 2, 2011, 1:02:52 PM7/2/11
to django...@googlegroups.com
Hi OP,

Is this requirement for a client, or some sort of paid work? If so,
quit the job and find something else.

If this requirement is for your own learning, then do exact that, and
figure these things out for yourself (django-users is not your
personal tutor, but Google is). For example, would it have killed to
type "linux howto" or "linux howto" or "linux for beginners" as a
search result?

Next time posting here, please use this as a guide:

https://code.djangoproject.com/wiki/UsingTheMailingList

Cal

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

ravinder singh

unread,
Jul 2, 2011, 1:22:38 PM7/2/11
to django...@googlegroups.com

Soviet

unread,
Jul 2, 2011, 1:29:35 PM7/2/11
to Django users
Yeah, I guess I did posted it with a bit of bitterness, since I
couldn't find exactly what i was looking for :). I'll keep trying on
my own!

ty for help Cal :).

On Jul 2, 7:02 pm, "Cal Leeming [Simplicity Media Ltd]"

Stuart

unread,
Jul 3, 2011, 2:15:15 PM7/3/11
to Django users
What you are describing is like trying to eat a 12-course meal in one
bite. If you have no command-line experience, I don't think it's going
to be a very pleasant experience for you. But here is how I would
approach it..

1) Figure out how to get Ubuntu Server running out on EC2 (http://
alestic.com/ is a good start)
2) Figure out how to install django on ubuntu (also google for
virtualenv and pip)
3) Figure out how to install / configure postgres on ubuntu
4) Figure out how to run django with a production-quality web server
(you mention apache, but I would consider nginx or similar).
5) Figure out how to install and configure solr

Of course each of those steps could be broken down quite a bit. Along
the way I reckon you'll work through getting around at the command-
line. Feel free to come back and ask more specific questions as you
run into problems.

Hope that helps,

--Stuart

Juergen Schackmann

unread,
Jul 4, 2011, 9:39:42 AM7/4/11
to django...@googlegroups.com
maybe http://www.turnkeylinux.org/ and especially http://www.turnkeylinux.org/django will do the heavy lifting for you

although I fully agree with the other replies, and I am not sure if you do yourself a favour using turnkeylinux just as a blackbox :-)

creecode

unread,
Jul 4, 2011, 12:04:48 PM7/4/11
to django...@googlegroups.com
Hello all,


On Sunday, July 3, 2011 11:15:15 AM UTC-7, Stuart wrote:

But here is how I would approach it..

1) Figure out how to get Ubuntu Server running out on EC2 (http://
alestic.com/ is a good start)
2) Figure out how to install django on ubuntu (also google for
virtualenv and pip)
3) Figure out how to install / configure postgres on ubuntu
4) Figure out how to run django with a production-quality web server
(you mention apache, but I would consider nginx or similar).
5) Figure out how to install and configure solr

Of course each of those steps could be broken down quite a bit.

Stuart has some good general advice there.

An alternative I'll mention which I've been using on EC2 is Amazon's own Linux AMI.  Seems to work pretty well for a server and has a good set of packages available.  They are doing pretty regular updates to their packages as well.

I'm running...

    Linux
    Upstart (for Gunicorn job management, comes with Amazon Linux AMI)
    Nginx
    Gunicorn
    Apache (for "mass" virtual hosting, Gunicorn's memory footprint seems not to compare favorably to Apache for this task, you can drop this if you're just hosting a few websites and stick with Gunicorn)
    mod_wsgi (goes along with Apache, not needed for Gunicorn)
    MySQL (use whatever database suits your needs)
    Python (of course! ;-) )
    virtualenv
    virtualenvwrapper
    pip
    Django (again, of course! :-) )
    Several dozen Python and Django related packages needed to run my websites.

Toodle-loooooooooooo....
creecode

DrBloodmoney

unread,
Jul 5, 2011, 6:00:11 AM7/5/11
to django...@googlegroups.com

An easy way to practice learning how to admin linux servers is to
download virtualbox and then download a server image (*.iso) from your
linux distro of choice (I prefer the Ubuntu/Debian side of things..
rec Ubuntu server). You can set up and then destroy without doing any
damage so you can easily setup again. The only way to learn this stuff
is to just get your hands dirty... it's not hard just kind of hard to
google generally. It's better to have specific errors to google for.

Nate Aune

unread,
Jul 5, 2011, 6:11:13 PM7/5/11
to django...@googlegroups.com
If you don't need SSH access to the machines that power this whole setup, you can use DjangoZoom, our one-click Django deployment and hosting service. It's built on top of Amazon and uses Nginx, PostgreSQL and as of a few days ago, we also now support Mercurial. The only gotcha might be Solr which we don't support yet, but you could probably connect a 3rd party Solr provider such as http://websolr.com to satisfy that requirement.

Sign up for the beta at http://djangozoom.com and mention that you heard about it on this thread to get an invite.

Nate
Reply all
Reply to author
Forward
0 new messages