scratch/output/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/index.html
Yann Esposito (Yogsototh) 7b5cfbf3e0 Updated content
2010-08-23 15:34:35 +02:00

210 lines
No EOL
9.8 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="blog">
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/main.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/twilight.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/idc.css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocomen"/>
<link rel="alternate" lang="fr" xml:lang="fr" title="Now heberged on heroku" type="text/html" hreflang="fr" href="/Scratch/fr/blog/2010-08-23-Now-heberged-on-heroku/" />
<link rel="alternate" lang="en" xml:lang="en" title="Now heberged on heroku" type="text/html" hreflang="en" href="/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/" />
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/Scratch/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Scratch/js/index.js"></script>
<title>Now heberged on heroku</title>
</head>
<body lang="en">
<script type="text/javascript">// <![CDATA[
document.write('<div id="blackpage"><img src="/Scratch/img/loading.gif" alt="loading..."/></div>');
// ]]>
</script>
<div id="content">
<div id="choix">
<div class="return"><a href="#entete">&darr; Menu &darr;</a></div>
<div id="choixlang">
<a href="/Scratch/fr/blog/2010-08-23-Now-heberged-on-heroku/" onclick="setLanguage('fr')">Version Française</a>
</div>
</div>
<div id="titre">
<h1>
Now heberged on heroku
</h1>
<h2>
Heberge static website on Heroku
</h2>
</div>
<div class="flush"></div>
<div class="flush"></div>
<div id="afterheader">
<div class="corps">
<h1 class="first" id="now-on-herokuhttpherokucom">Now on <a href="http://heroku.com">Heroku</a></h1>
<p>I now changed my hosting to <a href="http://heroku.com">Heroku</a>.
I believe it will be far more reliable.</p>
<p>But as you should know my website is completely static.
I use <a href="http://nanoc.stoneship.org/">nanoc</a> to generate it.
But here is the conf to make it work on heroku.</p>
<p>The root of my files is <code>/output</code>. You only need to create a <code>config.ru</code> file:</p>
<div class="code"><div class="file"><a href="/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/code/config.ru"> &#x27A5; config.ru </a></div><div class="withfile">
<pre class="twilight">
<span class="Keyword">require</span> <span class="String"><span class="String">'</span>rubygems<span class="String">'</span></span>
<span class="Keyword">require</span> <span class="String"><span class="String">'</span>rack<span class="String">'</span></span>
<span class="Keyword">require</span> <span class="String"><span class="String">'</span>rack-rewrite<span class="String">'</span></span>
use <span class="Support">Rack</span>::<span class="Entity">Rewrite</span> <span class="Keyword">do</span>
rewrite <span class="StringRegexp"><span class="StringRegexp">%r{</span><span class="StringRegexp"><span class="StringRegexp">(</span>.*<span class="StringRegexp">)</span></span>/$<span class="StringRegexp">}</span></span>,<span class="String"><span class="String">&quot;</span>$1/index.html<span class="String">&quot;</span></span>
<span class="Keyword">end</span>
use <span class="Support">Rack</span>::<span class="Entity">Static</span>, <span class="Constant"><span class="Constant">:</span>urls</span> =&gt; [<span class="String"><span class="String">&quot;</span>/<span class="String">&quot;</span></span>], <span class="Constant"><span class="Constant">:</span>root</span> =&gt; <span class="String"><span class="String">&quot;</span>output<span class="String">&quot;</span></span>
app <span class="Keyword">=</span> lambda { |<span class="Variable">env</span>| [<span class="Constant">404</span>, { <span class="String"><span class="String">'</span>Content-Type<span class="String">'</span></span> =&gt; <span class="String"><span class="String">'</span>text/html<span class="String">'</span></span> }, <span class="String"><span class="String">'</span>File Not Found<span class="String">'</span></span>] }
run app
</pre>
</div></div>
<p>and the <code>.gems</code> file needed to install <code>rack</code> middlewares.</p>
<div class="code"><div class="file"><a href="/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/code/.gems"> &#x27A5; .gems </a></div><div class="withfile">
<pre class="twilight">
rack
rack<span class="Keyword">-</span>rewrite
</pre>
</div></div>
<p>Now, just follow the heroku tutorial to create an application&nbsp;:</p>
<pre class="twilight">
git init
git add .
heroku create
git push heroku master
</pre>
<p>Now I&rsquo;ll should be able to redirect properly to my own 404 page for example.
I hope it is helpful.</p>
</div>
<div id="choixrss">
<a id="rss" href="http://feeds.feedburner.com/yannespositocomen">
Subscribe
</a>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#comment').hide();
$('#clickcomment').click(showComments);
});
function showComments() {
$('#comment').show();
$('#clickcomment').fadeOut();
}
document.write('<div id="clickcomment">Comments</div>');
</script>
<div class="flush"></div>
<div class="corps" id="comment">
<h2 class="first">comments</h2>
<noscript>
Vous devez activer javascript pour commenter.
</noscript>
<script type="text/javascript">
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/';
var idcomments_post_url = 'http://yannesposito.com/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='/Scratch/js/genericCommentWrapperV2.js'></script>
</div>
<div id="entete" class="corps_spaced">
<div id="liens">
<ul><li><a href="/Scratch/en/">Homepage</a></li>
<li><a href="/Scratch/en/blog/">Blog</a></li>
<li><a href="/Scratch/en/about/">About</a></li>
<li><a href="/Scratch/en/contact/">Contact</a></li></ul>
</div>
<div class="flush"></div>
<hr/>
<div id="next_before_articles">
<div id="previous_articles">
previous entries
<div class="previous_article">
<a href="/Scratch/en/blog/2010-07-09-Indecidabilities/">&larr; Undecidabilities (part 1)</a>
</div>
<div class="previous_article">
<a href="/Scratch/en/blog/2010-07-31-New-style-after-holidays/">&larr; New style after holidays</a>
</div>
<div class="previous_article">
<a href="/Scratch/en/blog/2010-07-07-CSS-rendering-problems-by-navigator/">&larr; Do not use CSS gradient with Chrome</a>
</div>
</div>
<div id="next_articles">
next entries
</div>
<div class="flush"></div>
</div>
</div>
<div id="bottom">
<div>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
</div>
<div id="lastmod">
Created: 08/23/2010 <br/>
Last modified: 08/23/2010
</div>
<div>
Entirely done with
<a href="http://www.vim.org">Vim</a>
and
<a href="http://nanoc.stoneship.org">nanoc</a>
</div>
<div>
<a href="/Scratch/en/validation/">Validation</a>
<a href="http://validator.w3.org/check?uri=referer"> [xhtml] </a>
.
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> [css] </a>
.
<a href="http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/en/blog/feed/feed.xml">[rss]</a>
</div>
</div>
<div class="clear"></div>
</div>
</body>
</html>