Are you till using a PHP blog under apache as if it were still in 1998? Do you need an awesome C10k Approved host that can also host Python / Rails and any other framework you might need?
Follow this guide to setup a Rockstar production server that will make you look like one (Step two after getting a cool domain name to become a rockstar dev).
Grow up and break with your cheap hosting
Your cheap PHP hosting company is actually not so cheap, you can get a full linux box for the same amount of money, plus you can configure it to be a lean, mean, bit serving machine, that can withstand any Slashdot effect. (Reddit effect for you youngsters)
Some awesome providers: Slicehost Amazon EC2 Linode Heroku Joyent Google App Engine
Install Nginx
After installing a vanilla Ubuntu:
1
| |
Setup Nginx
Edit /etc/nginx/sites-enabled/sanscourier.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Setup Octopress
Before the only reason to use a PHP blog was twofold: 1. To have your posts “safely” stored in a database. 2. So your readers can comment on your posts.
But as any old school sysadmin can tell you, scaling this setup starts easily and then becomes a big, boring chore involving CDNs, caches and other dirty tricks.
Octopress deals with this in an elegant manner: 1. Use a secure Git repo to store our posts. 2. Use disqus for commenting.
And lets face it, static websites make you look cool.
Setup rvm
In your server (or linux box or Mac running homebrew) (Why RVM? for the same reason we use Python’s virtualenvs, don’t dump where you eat, oh and yes you don’t need XCode nowadays.
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Setup octopress
Why Ruby? Because rubyists are rockstars thats why. (Actually I’m mostly a Python guy, but who cares anyway? I was using HP before! so go and try the right tool for the job).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Write something and deploy it.
You shoulb probaly read this instead. But here’s a quick intro:
1 2 3 4 5 | |
Don’t forget to deploy to your ~/sanscourier.com/ folder or some other safe place.
Meet Gunicorn
Did you know you can have a production ready server for Django in four simple steps? Please thank Eric Holscher for the tip
- Install django in a virtualenv
1 2 3 4 5 6 | |
- Add ‘gunicorn’ to your installed apps
- ./manage.py run_gunicorn -w 3 -/etc/gunicorn.conf.py
1 2 3 4 5 | |
And make nginx forward traffic to it
1 2 3 4 5 6 7 8 9 | |