News for hackers. Stuff that matters.
Re:Jekyll blog on Amazon S3 and CloudFront by smarx on Tuesday October 16, 2012 @12:23PM (#4660546)
For those of you who would prefer to just save your blog (or other static website) in Dropbox instead of uploading to S3, my startup just left beta today: http://www.site44.com

(Sorry for the shameless self-promotion; it's an exciting day for us!)

Re:Jekyll blog on Amazon S3 and CloudFront by rsync on Tuesday October 16, 2012 @05:55PM (#4662081)
Huh. Part of me says "get off my lawn" with your web publishing from your dropbox blah blah ...

But that's pretty cool ...

Re:Jekyll blog on Amazon S3 and CloudFront by zalew on Tuesday October 16, 2012 @07:26PM (#4662451)
there is also http://scriptogr.am/ for blog on dropbox
Re:Jekyll blog on Amazon S3 and CloudFront by bad_user on Tuesday October 16, 2012 @12:07PM (#4660439)
I also use Jekyll for my own blog [1]. However, because I really love naked domains (easier to dictate over the phone, shorter), I cannot do CNAMEs so I am hosting my blog on a free Heroku instance.

My initial Heroku config evolved too. I am now serving my pages through an Nginx server, installed with a custom buildpack [2] that I forked and modified a little to suit my directory structure (I could also make it compile the site on deploy but was too lazy for that).

I am also putting CloudFlare in front of it. Basically an article can end up on Hacker News, Reddit, Slashdot and the traffic combined will probably not make it even blink, while the hosting costs are zero.

Whenever I see people bitch about Wordpress woes, setups of clusters, security issues, or about caching/editing/versioning/archiving plugins or about costly add-ons and restrictions, it makes me chuckle a little - but then again, this setup is not for mere mortals or optimal for large content websites - for technical people however is a freaking nirvana.

[1] http://bionicspirit.com

[2] https://github.com/alexandru/heroku-buildpack-nginx

Re:Jekyll blog on Amazon S3 and CloudFront by jvoorhis on Tuesday October 16, 2012 @12:40PM (#4660621)
With AppFog [1], you can get WordPress with the tantan-s3 plugin pre-installed for uploads so you can share nothing (but the database) and scale with a click. You also get Varnish caching with no additional work.

Full disclosure: I am an engineer at AppFog.

[1] https://appfog.com/

Re:Jekyll blog on Amazon S3 and CloudFront by bad_user on Tuesday October 16, 2012 @01:02PM (#4660730)
I'm sure your service is useful, however allowed-plugins and other restrictions is something I like to avoid, not to mention that 1-click scaling is 1-click too many.

Wordpress is only useful if you want to publish in multiple categories with articles created by other (non-technical) people, need designs made by other designers - basically for a publishing factory or for people that don't want the hassle of learning to use Git, Jekyll and a good text editor.

However Jekyll/Git/Heroku is simplicity in its purest form, especially for developers and with simplicity comes a lot of power ... like I've had 2 blogs before this one and I lost the content on both out of ignorance, by stopping payments to my hosting provider, then later regretted it.

My content right now is on my laptop, mirrored by both GitHub and Heroku and you get for free the history of all changes, while the articles themselves get edited in the most powerful text-editor ever created (Emacs). Scaling comes for free. Costs are zero. The domain is mine. I can publish however many ads I want (coughwordpress.comcought). It wouldn't lock me out if I were under 18 (coughblogger.comcough).

To me that's just awesome. On the other hand it's just a stupid blog. Which it should be. Which is why less is more.

Re:Jekyll blog on Amazon S3 and CloudFront by noinput on Tuesday October 16, 2012 @02:13PM (#4661090)
I host my current Octopress/Jekyll blog with Appfog and gave it a thorough thrashing with ab [apache bench] and blitz.io, performance has been great. It's easy enough to simply run an `af update` instead of `git push heroku`, in that sense.
Re:Jekyll blog on Amazon S3 and CloudFront by cmwelsh on Tuesday October 16, 2012 @01:53PM (#4660983)
Where is your fork of tantan-s3? If I recall it hasn't been updated by the author in over 4 years. I have a fork on GitHub here but it's not great:

https://github.com/cmwelsh/wordpress-s3

Re:Jekyll blog on Amazon S3 and CloudFront by amalag on Tuesday October 16, 2012 @05:43PM (#4662027)
There is a certificate error on that redirected naked domain for https://appfog.com
Re:Jekyll blog on Amazon S3 and CloudFront by jvoorhis on Thursday October 18, 2012 @07:54PM (#4671653)
Thanks for pointing that out. We'll have it repaired right away.
Re:Jekyll blog on Amazon S3 and CloudFront by amalag on Friday October 19, 2012 @07:53AM (#4673097)
Still broken, appfog.com still gives me a certificate for: redirector.zerigo.net
Re:Jekyll blog on Amazon S3 and CloudFront by zrail on Tuesday October 16, 2012 @02:36PM (#4661202)
I looked at Jekyll for my recent blog rewrite[1] but I ended up writing my own[2] and hosting it on Heroku, for many of the same reason. Even without CloudFlare it's been able to handle HN homepage and subreddit hits with no perceptible performance issues.

[1]: http://bugsplat.info/2011-12-14-yet-another-not-very-static-... [2]: https://github.com/peterkeen/bugsplat.rb

Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @02:18PM (#4661113)
Amen on the Nerd Nirvana! :)

Personally I prefer [1] using a subdomain over the bare domain. If your registrar doesn't support www redirection you could always use WWWizer [2].

[1] http://vvv.tobiassjosten.net/internet/using-www-for-your-dom... [2] http://wwwizer.com/

Re:Jekyll blog on Amazon S3 and CloudFront by tedchs on Tuesday October 16, 2012 @03:09PM (#4661354)
WWWizer is pretty cool, but I'd rather roll my own on Heroku. I have a Heroku "app" that Heroku thinks is PHP, but it just contains a .htaccess file with some RewriteRule directives to 301 http://example.com to http://www.example.com. I then do the real hosting elsewhere. :)
Re:Jekyll blog on Amazon S3 and CloudFront by zrail on Tuesday October 16, 2012 @07:04PM (#4662374)
Heroku is great for precisely this reason. Dynos are basically customizable http legos.
Re:Jekyll blog on Amazon S3 and CloudFront by stephenhuey on Tuesday October 16, 2012 @06:23PM (#4662224)
That's awesome--I didn't know CloudFlare has a free layer. I'd thought about using S3 or Heroku for hosting static webpages, but I didn't feel like trusting a single Heroku dyno to a traffic surge and lost my interest in using S3 once I found out Google Cloud Storage now lets you host naked domains!
Re:Jekyll blog on Amazon S3 and CloudFront by tomjakubowski on Tuesday October 16, 2012 @04:38PM (#4661705)
One very nice side-effect of hosting on GitHub is that it integrates very nicely with your repository GitHub pages. URLs for your repos are simply http://domain/reponame. For example (apologies for the self-promotion):

* my website, hosted on GitHub: http://crystae.net/

* toy cellular automata project, hosted on GitHub: http://crystae.net/automatra

Author's argument about Github Pages not allowing custom Jekyll plugins is true, but you can always build the site locally with whatever plugins you like and deploy the built copy (see Octopress[1] for a popular example of this).

1: http://octopress.org/

Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @04:49PM (#4661760)
That's definitely an option and to be fair I didn't use any Jekyll plugins up until recently. But my main gripe is still the lacking redirection. I can't lose that ability for this blog and all its accumulated URL fixes over the years.

For new blogs I could definitely consider GitHub Pages. In fact I use it for one I started just a month ago.

Re:Jekyll blog on Amazon S3 and CloudFront by andrewcooke on Tuesday October 16, 2012 @12:26PM (#4660568)
i think the 1% may not very accurate? my blog is also rated as being in the top 1% and it doesn't use cloudfront or s3 or anything cool like that. it's just static pages at webfaction (who are nice guys, but still, it's a shared host).

not trying to diss the post, which was very interesting, just suspect of the pingdom stats. unless using static pages alone is sufficient to get you into the fastest 1% these days? i guess it's possible. maybe they're hosted nearby... [update: the traceroutes differ in where they enter the usa]

Re:Jekyll blog on Amazon S3 and CloudFront by jvoorhis on Tuesday October 16, 2012 @12:38PM (#4660609)
Nearby Pingdom? It's always possible that you're in the same data center. In theory, CloudFront pages are always hosted nearby.
Re:Jekyll blog on Amazon S3 and CloudFront by engtech on Tuesday October 16, 2012 @11:35AM (#4660253)
If wordpress.com can exist offering to host people's blogs, I think someone could create a site that does these techniques in the backend and provides a nice content management front end.
Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @02:45PM (#4661235)
You could probably just slap CloudFront on the existing WP site. Might have side-effects but it would surely bump the performance up.
Re:Jekyll blog on Amazon S3 and CloudFront by fjw on Tuesday October 16, 2012 @05:35PM (#4661987)
There actually is a way to redirect requests on GitHub Pages. It's a bit hacky, but if you want to stick with GitHub's hosting, it might be worth doing.

You can manually create a new page "index.html" in the corresponding subdirectory for your redirect. If you want /post/oops-i-made-a-tpyo to redirect to your updated oops-i-made-a-typo link, you would create /post/oops-i-made-a-tpyo/index.html and make an HTML redirect:

  <meta http-equiv="refresh" content="0;url=/post/oops-i-made-a-typo/" />
You can see this at work on my blog [1] and the code for the redirects I made [2] when migrating from Tumblr.

[1] http://frankjwu.com/

[2] https://github.com/frankjwu/frankjwu.github.com/tree/master/...

Re:Jekyll blog on Amazon S3 and CloudFront by gwern on Tuesday October 16, 2012 @06:02PM (#4662116)
I switched my Hakyll site from NFSN to Amazon S3 back in June. My basic observations here would be:

1. I don't see why you would bother with Amazon's CloudFront. CloudFlare is as easy to use and free, unlike CloudFront; it's worked well for me. 2. s3cmd is a good utility, but there are occasional cornercases. On my Debian testing system, use of '--guess-mime-type --mime-type=text/html' may have... unfortunate consequences for quite a few files you would not expect, such as CSS or image files.

Re:Jekyll blog on Amazon S3 and CloudFront by koenbok on Tuesday October 16, 2012 @01:42PM (#4660940)
My side project Cactus is a simpler alternative to Jekyll and has s3 deployments built in: https://github.com/koenbok/Cactus
Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @02:24PM (#4661147)
The rate at which these generators pop up is a testament to how awesome they are. I really think you're on to something with the built-in S3 deployment. Any plans for extending it with CloudFront caching?
Re:Jekyll blog on Amazon S3 and CloudFront by mafro on Monday October 22, 2012 @01:03AM (#4681920)
For anyone wondering why you might not want to use GH pages, and use S3/Cloudfront instead... The Git 1.8 release notes ended up with this today:

"You're over the rate limit. Serve this file from your own servers. Contact [email protected] if you have questions."

https://raw.github.com/git/git/master/Documentation/RelNotes...

Re:Jekyll blog on Amazon S3 and CloudFront by tikhonj on Tuesday October 16, 2012 @11:26AM (#4660212)
I wonder what the costs are like. Just looking at the S3 page, it seems this would actually be rather cheap, which makes it an attractive option (especially for a student like me :P). However, I'm not entirely certain on how much resources a small blog like this would use, so I don't know exactly how expensive it would be.
Re:Jekyll blog on Amazon S3 and CloudFront by Jach on Tuesday October 16, 2012 @11:46AM (#4660314)
I run my blog off an EC2 Micro instance running Apache, which Amazon conveniently offers a free year of service for. (And it's not expensive paying for it yourself either ($69/yr for a Small). I used to use HostGator, AWS is much nicer--apart from outgoing emails, but once you're set up you're good.)

Pingdom is kind of nifty for its comparisons. I got the author's site to be only in the top 97% by running the benchmark again. My own site varies from being in the top 90% to 96% (I did get a 99% once), the only real "optimization" I do is reading cached pages from "disk" (EBS is notoriously pretty slow). I could probably shave off an average 100ms with some really simple tricks. Under heavy load I'm certain I'd fall over on such a puny machine that isn't even using nginx+memcached.

Re:Jekyll blog on Amazon S3 and CloudFront by pjungwir on Tuesday October 16, 2012 @02:00PM (#4661031)
According to the pricing page [1], a reserved Small is $69/yr plus $0.039 for any hour the instance is running, which could add up to another $341 for the year.

[1] http://aws.amazon.com/ec2/pricing/

Re:Jekyll blog on Amazon S3 and CloudFront by Jach on Wednesday October 17, 2012 @04:28AM (#4663604)
Good catch, I just quickly glanced at the figure without remembering the hourly rates still apply. Going with the yearly-reserved Micro you're at $128 for the year, which is a bit more than many shared hosts but at least you have absolute power over the software.
Re:Jekyll blog on Amazon S3 and CloudFront by bad_user on Wednesday October 17, 2012 @08:37AM (#4664092)
Just for a Jekyll blog, you could just host it on a free Heroku instance with an Nginx server and put CloudFlare in front of it.

In a free Heroku instance you have a lot of juice actually, especially for an Nginx server, the only problem being that the instance will go in idle mode after an hour of inactivity and so unlucky visitors can get some latency on the first request, although it's not that awful.

On the other hand CloudFlare is a pretty good proxy that works like a CDN, so with the right caching headers set, CloudFlare will serve many requests from its own cache.

Re:Jekyll blog on Amazon S3 and CloudFront by spindritf on Tuesday October 16, 2012 @01:08PM (#4660759)
> Pingdom is kind of nifty for its comparisons. I got the author's site to be only in the top 97% by running the benchmark again. My own site varies from being in the top 90% to 96% (I did get a 99% once)

If you strive for geek cred, you can get

> Your website is faster than 100% of all tested websites

The trick is to 1. have a static website, obviously, and everything inlined (so basically a single index.html); 2. run the test twice — dns responses should cache during the first one; 3. host your website in Amsterdam which is where they have (at least one of) their testers:

> Tested from Amsterdam, Netherlands on October 16 at 19:04:21

Oh, and don't use SSL.

Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @02:58PM (#4661312)
Check out Amazon's pricing pages ([1] and [2]) for details.

As for resources spent, my own blog has had just over 10k pageviews since Saturday when I launched on S3/CF and for that I'm paying $0.07 (S3) + $0.12 (CF) = a whooping $0.19! Including a lot of writing files back and forth to get everything up and running.

[1] http://aws.amazon.com/s3/pricing/ [2] http://aws.amazon.com/cloudfront/pricing/

Re:Jekyll blog on Amazon S3 and CloudFront by pessimism on Tuesday October 16, 2012 @12:25PM (#4660556)
This is what a bill for my blog with some hundreds or few thousands of hits looks like: http://pygm.us/s6mFV+OP. This is solely S3.

Aside from being unable to figure out a anti-hotlink bucket policy, S3 is great and basically free in most for most blogs.

The blog: http://pygm.us/q6Nv3lja.

Re:Jekyll blog on Amazon S3 and CloudFront by tikhonj on Tuesday October 16, 2012 @01:08PM (#4660761)
Wow, that's awesome.

Of course it's still literally infinitely larger than my current income :P. (I'm abusing the word "infinitely" horribly, but so be it.)

I think I'm almost definitely going to go the S3 route when I get around to redoing my site and starting a blog. (One day...)

Re:Jekyll blog on Amazon S3 and CloudFront by michaelt on Tuesday October 16, 2012 @12:11PM (#4660455)
I do this for my little personal website.

The key downside to hosting directly on S3 is it only does static pages. So it'll be manual HTML or a static-html-generating-tool like Octopress - none of this fancy dynamic content.

If you're happy with this constraint, hosting on S3 works pretty well for me.

Re:Jekyll blog on Amazon S3 and CloudFront by tikhonj on Tuesday October 16, 2012 @12:17PM (#4660507)
I'm actually very happy with that constraint: I think something statically generated would be perfect for my goals and much simpler to use, understand and customize than something like Wordpress. The only thing to miss would be comments, but I was planning to use something like Diqus for that anyhow. (I will start a blog, one of these days :P.)

Also, almost anything would be an improvement over my current setup which is using PHP on Apache to do what a static compiler would do much better. All I really want is a way to factor my website and reduce code duplication.

Good to hear it's working well for you.

Re:Jekyll blog on Amazon S3 and CloudFront by ceworthington on Tuesday October 16, 2012 @11:05AM (#4660109)
Optimizing is often an after-thought on side projects, so it's cool to see you take a stab at it for your personal blog.
Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @03:01PM (#4661324)
Glad you like it! Definitely nice when you get to take the time with these kind of projects.
Re:Jekyll blog on Amazon S3 and CloudFront by rsync on Tuesday October 16, 2012 @06:10PM (#4662154)
Just to clarify, are you saying in your blog post that you can't point a bare domain to your cloudfront endpoint, and that you have to use something like wwwizer to use a bare domain with your cloudfront setup ?
Re:Jekyll blog on Amazon S3 and CloudFront by mattdeboard on Tuesday October 16, 2012 @08:16PM (#4662622)
No, you can specify multiple CNAME values for a single CloudFront distribution; afaik nothing stopping you from configuring 'foo.example.com', 'bar.example.com' and 'example.com' to all point to 'randomletters.cloudfront.net'
Re:Jekyll blog on Amazon S3 and CloudFront by bad_user on Wednesday October 17, 2012 @08:43AM (#4664114)
You cannot point naked domains (like example.com) to CloudFront, because naked domains can only be configured with A records, not with CNAMEs.
Re:Jekyll blog on Amazon S3 and CloudFront by mattdeboard on Wednesday October 17, 2012 @12:26PM (#4665179)
I see, thanks.
Re:Jekyll blog on Amazon S3 and CloudFront by minhajuddin on Tuesday October 16, 2012 @02:56PM (#4661307)
For developers who want a simple blogging engine. Try http://substancehq.com . All your blog's content will be served via varnishd which is an awesome cache.
Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @03:05PM (#4661334)
Varnish would have been fun to play with for a static blog. For one thing you then could use ESI to not have to invalidate the cache as often.

But I disagree with one thing — the "git push → deploy dance" is a pro for Jekyll! ;)

Re:Jekyll blog on Amazon S3 and CloudFront by minhajuddin on Tuesday October 16, 2012 @03:12PM (#4661366)
I have found it to be fun the first few times, but as your blog grows I've found it to be a pain to deploy every time I make a small correction. Also, with markdown there are always corrections to be made for formatting purposes.
Re:Jekyll blog on Amazon S3 and CloudFront by wiredfool on Tuesday October 16, 2012 @07:22PM (#4662429)
I was watching a demo of Jekyll and Octopress pushed to github at a user group meeting. As a demo, the presenter made the requisite small change, committed, and pushed.

5 MB of upload later on a clogged wifi link, it was up live. Admittedly, that's because the generation was done on his laptop and pushed up, not done on the server side. But 5mb and a ton of rendering time is going to suck if you're ever changing things for formatting, or edit anything.

Re:Jekyll blog on Amazon S3 and CloudFront by jh3 on Tuesday October 16, 2012 @11:49AM (#4660329)
I just noticed your domain is vvv.tobiassjosten.net.
Re:Jekyll blog on Amazon S3 and CloudFront by tobiassjosten on Tuesday October 16, 2012 @02:48PM (#4661253)
Re:Jekyll blog on Amazon S3 and CloudFront by mise on Tuesday October 16, 2012 @03:06PM (#4661340)
Even clicking through to the link, it loaded faster than I could Alt-Tab to the next window.