<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title><![CDATA[MSylvia]]></title>
  <subtitle><![CDATA[4D53796C766961]]></subtitle>
  <link href="/rss.xml" rel="self"/>
  <link href="http://msylvia.nukefile.net//"/>
  <updated>2014-01-08T22:37:29.432Z</updated>
  <id>http://msylvia.nukefile.net//</id>
  
  <author>
    <name><![CDATA[MSylvia]]></name>
    
  </author>
  
  <generator uri="http://zespia.tw/hexo/">Hexo</generator>
  
  <entry>
    <title><![CDATA[Running Hexo on Hostgator]]></title>
    <link href="http://msylvia.nukefile.net/2013/12/28/running-hexo-on-hostgator/"/>
    <id>http://msylvia.nukefile.net/2013/12/28/running-hexo-on-hostgator/</id>
    <published>2013-12-28T17:27:25.000Z</published>
    <updated>2013-12-28T21:11:15.000Z</updated>
    <content type="html"><![CDATA[<p>I have been searching for a static site generator for a while and there are lots of great ones out there but none of them were a good fit for me. Then I found <a href="http://zespia.tw/hexo/" title="Hexo" target="_blank">Hexo</a>. </p>
<p>Its small, fast, has templates and archives, supports markdown. It’s awesome. One downside .. it requires <a href="http://nodejs.org/download/" title="node.js" target="_blank">node.js</a>. In my case I’m on shared hosting so I <del>can’t</del> shouldn’t run node as a server because they probably won’t be too happy about that. </p>
<p>But there should be no problem just using it as a CLI static site generator and not running long server processes. The only thing I need to do to make things run smoothly is to turn off multi-threading and thankfully there’s a setting for that.</p>
<p>So here’s the steps I did to get this all setup.</p>
<a id="more"></a>

<blockquote>
<p>Note: Do this at your own risk.</p>
</blockquote>
<p>Lets get started. If you try to run <code>node</code> you’ll get this error in response.</p>
<p><code>-jailshell: node: command not found</code></p>
<p>You’ll need to install the binary manually. Currently the latest node version is <code>v0.10.24</code>. The URL for the latest that you’ll need is on node’s website <a href="http://nodejs.org/download/" title="node.js" target="_blank"><a href="http://nodejs.org/download/">http://nodejs.org/download/</a></a> under Linux Binaries (.tar.gz) 32bit.</p>
<p>After you ssh into your account download and extract node</p>
<figure class="highlight lang-bash"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre>wget http://nodejs.org/dist/v0.<span class="number">10.24</span>/node-v0.<span class="number">10.24</span>-linux-x86.tar.gz
tar -zxvf node-v0.<span class="number">10.24</span>-linux-x86.tar.gz
rm node-v0.<span class="number">10.24</span>-linux-x86.tar.gz
mv node-v0.<span class="number">10.24</span>-linux-x86 node
<span class="built_in">cd</span> node
</pre></td></tr></table></figure>

<p>Running <code>./bin/node -v</code> should show the correct version number <code>v0.10.24</code>.</p>
<p>Next you need to edit your bash profile and add the correct paths to the node bin directory.</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
</pre></td><td class="code"><pre><span class="title">nano</span> .bash_profile
</pre></td></tr></table></figure>

<blockquote>
<p>Note: Your .bash_profile may be different, The important lines are between the comments.</p>
</blockquote>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre><span class="comment">PATH=$PATH:$HOME/bin</span>

<span class="comment">#</span> <span class="comment">NODE</span><span class="string">.</span><span class="comment">js</span>
<span class="comment">#</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span>
<span class="comment">PATH=</span><span class="string">.</span><span class="comment">/node_modules/</span><span class="string">.</span><span class="comment">bin:$PATH</span>
<span class="comment">PATH=$HOME/node/bin:$PATH</span>
<span class="comment">#</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span><span class="literal">-</span>

<span class="comment">export</span> <span class="comment">PATH</span>
</pre></td></tr></table></figure>

<p>After saving that file reload the profile</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
</pre></td><td class="code"><pre><span class="built_in">source</span> .bash_profile
</pre></td></tr></table></figure>

<p>and try running <code>node -v</code> it should show the version number again. Now we can install Hexo. </p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre><span class="title">npm</span> install hexo -g
<span class="title">npm</span> update hexo -g
<span class="title">hexo</span> version
</pre></td></tr></table></figure>

<p>Next you need to edit the <code>_config.yml</code> file to turn off multi-threading. </p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
</pre></td><td class="code"><pre><span class="attribute">multi_thread</span>: <span class="string">false</span>
</pre></td></tr></table></figure>

<p>Then you should be good to go. From here you can follow the <a href="http://zespia.tw/hexo/docs/index.html" title="Hexo Docs" target="_blank">Hexo Docs</a> to get things started.</p>
]]></content>
    <summary type="html"><![CDATA[<p>I have been searching for a static site generator for a while and there are lots of great ones out there but none of them were a good fit for me. Then I found <a href="http://zespia.tw/hexo/" title="Hexo" target="_blank">Hexo</a>. </p>
<p>Its small, fast, has templates and archives, supports markdown. It’s awesome. One downside .. it requires <a href="http://nodejs.org/download/" title="node.js" target="_blank">node.js</a>. In my case I’m on shared hosting so I <del>can’t</del> shouldn’t run node as a server because they probably won’t be too happy about that. </p>
<p>But there should be no problem just using it as a CLI static site generator and not running long server processes. The only thing I need to do to make things run smoothly is to turn off multi-threading and thankfully there’s a setting for that.</p>
<p>So here’s the steps I did to get this all setup.</p>
]]></summary>
    
      <category term="hexo" scheme="http://msylvia.nukefile.net/tags/hexo/"/>
    
      <category term="hostgator" scheme="http://msylvia.nukefile.net/tags/hostgator/"/>
    
      <category term="node.js" scheme="http://msylvia.nukefile.net/tags/node.js/"/>
    
  </entry>
  
</feed>
